{"name":"reduce-css-calc","version":"2.0.5","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__/"},"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.4.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":"^0.4.17"},"dependencies":{"css-unit-converter":"^1.1.1","postcss-value-parser":"^3.3.0"},"eslintConfig":{"parser":"babel-eslint","extends":"eslint-config-i-am-meticulous"},"gitHead":"b95919adc3bd7d42cef1b1dce912d5dad781c49f","bugs":{"url":"https://github.com/MoOx/reduce-css-calc/issues"},"homepage":"https://github.com/MoOx/reduce-css-calc#readme","_id":"reduce-css-calc@2.0.5","_shasum":"33c97838c5d4c711a5c14ef85ce4fde41483f7bd","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"beneb","email":"beneb.info@gmail.com"},"dist":{"shasum":"33c97838c5d4c711a5c14ef85ce4fde41483f7bd","tarball":"http://registry-npm.ywwl.com/reduce-css-calc/download/reduce-css-calc-2.0.5.tgz","integrity":"sha512-YXolRI77wUmezpkDwKyubK4fpSV2C23j5dJ5dWtoL1qg9jOBp8oBVhCYg6MDso424l6PIW3CdOknF8J/dqbuZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvpQDY1Ou5MEq51LDCwYUtyDyB2WEq7yc9uwqzEpQmogIgWxTo3XBc6SeGpyRjec0N3uLsqx9Spd62QCNl33N3IPc="}],"size":12859,"noattachment":false,"key":"/reduce-css-calc/-/reduce-css-calc-2.0.5.tgz"},"maintainers":[{"name":"beneb","email":"beneb.info@gmail.com"},{"name":"moox","email":"m@moox.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/reduce-css-calc-2.0.5.tgz_1494603828915_0.36635913816280663"},"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":1494603830777,"_cnpm_publish_time":1494603830777,"dist-tags":{"latest":"2.1.8"}}