{"name":"reduce-css-calc","version":"1.2.8","description":"Reduce CSS calc() function to the maximum","keywords":["css","calculation","calc"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/MoOx/reduce-css-calc.git"},"files":["index.js"],"dependencies":{"balanced-match":"^0.4.2","math-expression-evaluator":"^1.2.14","reduce-function-call":"^1.0.1"},"devDependencies":{"jscs":"^1.5.9","jshint":"^2.5.2","npmpub":"^3.0.3","tape":"^2.13.4"},"scripts":{"jscs":"jscs *.js **/*.js","jshint":"jshint . --exclude node_modules","test":"npm run jscs && npm run jshint && tape test","release":"npmpub"},"gitHead":"f8b50e39ec0ae9e023e9529ffd00fb07c48f1b05","bugs":{"url":"https://github.com/MoOx/reduce-css-calc/issues"},"homepage":"https://github.com/MoOx/reduce-css-calc#readme","_id":"reduce-css-calc@1.2.8","_shasum":"ee054cf300ec4c1a7c0cf40af0e1ed8c9a6fb377","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"moox","email":"m@moox.io"},"dist":{"shasum":"ee054cf300ec4c1a7c0cf40af0e1ed8c9a6fb377","tarball":"http://registry-npm.ywwl.com/reduce-css-calc/download/reduce-css-calc-1.2.8.tgz","integrity":"sha512-lc2r6FBTm0nCaGL0U5TMo87yF4z8b9z05diaUfC9gB9gzKUwmg7Qx4085lTp/qLqTRwGxVoNkH0IrnsDR17h3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH6e+2GnQULavRl79d9JRxa9ODGdNXe/+25k8sz30tDIAiEApmQUUI+Or8Nj7aV8aYvJv678M6xil5K23EVDMzA6yd4="}],"size":4021,"noattachment":false,"key":"/reduce-css-calc/-/reduce-css-calc-1.2.8.tgz"},"maintainers":[{"name":"moox","email":"m@moox.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/reduce-css-calc-1.2.8.tgz_1472206436640_0.169512661639601"},"directories":{},"readme":"# reduce-css-calc\n\n[![Build Status](https://travis-ci.org/MoOx/reduce-css-calc.svg)](https://travis-ci.org/MoOx/reduce-css-calc)\n\n> Reduce CSS calc() function to the maximum.\n\nParticularly useful for packages like [rework-calc](https://github.com/reworkcss/rework-calc) or [postcss-calc](https://github.com/postcss/postcss-calc).\n\n## Installation\n\n```console\nnpm install reduce-css-calc\n```\n\n## Usage\n\n### `var reducedString = reduceCSSCalc(string, precision)`\n\n```javascript\nvar reduceCSSCalc = require('reduce-css-calc')\n\nreduceCSSCalc(\"calc(1 + 1)\")\n// 2\n\nreduceCSSCalc(\"calc((6 / 2) - (4 * 2) + 1)\")\n// -4\n\nreduceCSSCalc(\"calc(1/3)\")\n// 0.33333\n\nreduceCSSCalc(\"calc(1/3)\", 10)\n// 0.3333333333\n\nreduceCSSCalc(\"calc(3rem * 2 - 1rem)\")\n// 5rem\n\nreduceCSSCalc(\"calc(2 * 50%)\")\n// 100%\n\nreduceCSSCalc(\"calc(120% * 50%)\")\n// 60%\n\nreduceCSSCalc(\"a calc(1 + 1) b calc(1 - 1) c\")\n// a 2 b 0 c\n\nreduceCSSCalc(\"calc(calc(calc(1rem * 0.75) * 1.5) - 1rem)\")\n// 0.125rem\n\nreduceCSSCalc(\"calc(calc(calc(1rem * 0.75) * 1.5) - 1px)\")\n// calc(1.125rem - 1px)\n\nreduceCSSCalc(\"-moz-calc(100px / 2)\")\n// 50px\n\nreduceCSSCalc(\"-moz-calc(50% - 2em)\")\n// -moz-calc(50% - 2em)\n```\n\nSee [unit tests](src/__tests__/index.js) for others examples.\n\n---\n\n## Contributing\n\nWork on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.\n\n```console\ngit clone https://github.com/MoOx/reduce-css-calc.git\ngit checkout -b patch-1\nnpm install\nnpm test\n```\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE-MIT)\n","publish_time":1472206438276,"_cnpm_publish_time":1472206438276,"dist-tags":{"latest":"2.1.8"}}