{"name":"reduce-css-calc","version":"2.1.4","description":"Reduce CSS calc() function to the maximum","keywords":["css","calculation","calc"],"main":"dist/index.js","files":["dist"],"scripts":{"prepublish":"npm run build && del-cli dist/__tests__","build":"del-cli dist && cross-env BABEL_ENV=publish babel src --out-dir dist && jison parser.jison -o dist/parser.js","pretest":"eslint src && npm run build","test":"ava dist/__tests__/","release":"npmpub"},"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/MoOx/reduce-css-calc.git"},"devDependencies":{"ava":"^0.18.2","babel-cli":"^6.18.0","babel-core":"^6.21.0","babel-eslint":"^7.1.1","babel-plugin-add-module-exports":"^0.2.1","babel-preset-env":"^1.6.0","babel-register":"^6.18.0","cross-env":"^3.1.4","del-cli":"^0.2.1","eslint":"^3.12.2","eslint-config-i-am-meticulous":"^6.0.1","eslint-plugin-babel":"^4.0.0","eslint-plugin-import":"^2.2.0","jison":"git+https://github.com/download13/jison.git#b7d6e0de7d2c2c1bde5451b8e99813843a473315","npmpub":"^3.1.0"},"dependencies":{"css-unit-converter":"^1.1.1","postcss-value-parser":"^3.3.0"},"eslintConfig":{"parser":"babel-eslint","extends":"eslint-config-i-am-meticulous"},"gitHead":"00eb6f3f9588136430fb24cbf401d2ad0f976c24","bugs":{"url":"https://github.com/MoOx/reduce-css-calc/issues"},"homepage":"https://github.com/MoOx/reduce-css-calc#readme","_id":"reduce-css-calc@2.1.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"moox","email":"m@moox.io"},"dist":{"integrity":"sha512-i/vWQbyd3aJRmip9OVSN9V6nIjLf/gg/ctxb0CpvHWtcRysFl/ngDBQD+rqavxdw/doScA3GMBXhzkHQ4GCzFQ==","shasum":"c20e9cda8445ad73d4ff4bea960c6f8353791708","tarball":"http://registry-npm.ywwl.com/reduce-css-calc/download/reduce-css-calc-2.1.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFbUqtE6Tzc81P+7kgQebIF0cycmdQMIfm2roDZq+CAAiEA9+ne46+IOslEaRp41tLIo1D4KnFIZhkwDm7dBcz1YzA="}],"size":13236,"noattachment":false,"key":"/reduce-css-calc/-/reduce-css-calc-2.1.4.tgz"},"maintainers":[{"email":"semigradskyd@gmail.com","name":"semigradsky"},{"email":"beneb.info@gmail.com","name":"beneb"},{"email":"m@moox.io","name":"moox"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce-css-calc-2.1.4.tgz_1516609883339_0.44436564249917865"},"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":1516609884253,"_cnpm_publish_time":1516609884253,"dist-tags":{"latest":"2.1.8"}}