{"name":"csscomb-core","version":"3.0.0","description":"Framework for writing postprocessors","dependencies":{"gonzales-pe":"^3.3.6","minimatch":"0.2.12","vow":"0.4.4","vow-fs":"0.3.2"},"devDependencies":{"babel":"^5.5.3","jscs":"1.13.x","jshint":"2.8.x","mocha":"1.20.x","unit-coverage":"3.4.x"},"main":"lib/core.js","maintainers":[{"name":"tonyganch","email":"tonyganch+github@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/csscomb/core.git"},"scripts":{"postinstall":"./scripts/postinstall.sh","build":"./scripts/build.sh","coverage":"./scripts/build.sh && ./scripts/coverage.sh","test":"./scripts/build.sh && ./scripts/test.sh"},"gitHead":"b4fc929cc9d293ef6337d3fbb832ccefcbab1a88","bugs":{"url":"https://github.com/csscomb/core/issues"},"homepage":"https://github.com/csscomb/core#readme","_id":"csscomb-core@3.0.0","_shasum":"094f6204e694a22869389be8e90439e6d0705404","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"tonyganch","email":"tonyganch+github@gmail.com"},"dist":{"shasum":"094f6204e694a22869389be8e90439e6d0705404","tarball":"http://registry-npm.ywwl.com/csscomb-core/download/csscomb-core-3.0.0.tgz","integrity":"sha512-yTNkiCqUwBuRT8NZ5A2XwF7pIvhakUwx2OcevsllVx5LJCRFOimuOjd7RXtkLoTwUq8q/2r5D6X+7+EubjSUTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBF7w+tLKYSHSPoc6o+pDqNWKdhtg2fgqaYcDU7nVgzRAiEAuKn+QQOqcqfc0pt1Hm3+eJTcB0syWS2Fm0o47qPng90="}],"size":9304,"noattachment":false,"key":"/csscomb-core/-/csscomb-core-3.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/csscomb-core-3.0.0.tgz_1468274294721_0.4901491205673665"},"readme":"# CSScomb Core\n\nCSScomb Core is a framework for writing postprocessors.  \nIt provides you with a nice set of features:\n\n1. Parser with support of preprocessors\n1. API to create and use options\n1. API to process files and directories\n\n\n## Usage\n\n```js\nvar Comb = require('csscomb-core');\n// Constructor accepts a list of options to use and list of acceptable syntaxes.\nvar comb = new Comb(options, 'css');\n```\n\nFor a simple example of usage take a look\n[at a template project](https://github.com/csscomb/core-template).  \nFeel free to fork it and modify.\n\n## List of public methods\n\nThere are a number of methods that become available once you create an instance.\n\n### comb.use(option)\n\nUse a plugin.\n\n- Params: *{Object}*  Option's plugin\n- Return: *{CombCore}*  Instance's object\n\n### comb.configure(config)\n\nLoad configuration from JSON.  \nActivate and configure needed options.\n\n- Params: *{Object}*  Config\n- Return: *{CombCore}*  Instance's object\n\n### comb.getOptionsOrder()\n\nGet list of available options in exact order they will be processed.  \nCan be used for testing purpose.\n\n- Return: *{Array}*  List of options' names\n\n### comb.getValue(optionName)\n\nGet option's value.  \nCan be used inside plugin's `process` method.\n\n- Params: *{String}*  Option's name\n- Return: Value set by user for this option\n\n### comb.getSyntax()\n\nGet name of syntax that is currently being used.  \nCan be used inside plugin's `process` method.\n\n- Return: *{String}*  Syntax name\n\n### comb.lintPath(path)\n\nLint a file or a directory.\n\n- Params: *{String}*  Path to file or directory</td>\n- Return: *{Promise}*\n\n### comb.lintDirectory(path)\n\nLint all files in a directory.\n\n- Params: *{String}*  Path to file or directory</td>\n- Return: *{Promise}*\n\n### comb.lintFile(path)\n\nLint a single file.\n\n- Params: *{String}*  Path to file\n- Return: *{Promise}*\n\n### comb.lintString(string, options)\n\nLint a string.\n\n- Params:  \n  *{String}*  Code to process  \n  *{{context: String, filename: String, syntax: String}}* Options (optional)\n  where *context* is\n  Gonzales PE rule, *filename* is a file's name that is used to display errors and\n  *syntax* is syntax name with `css` being a default value.  \n- Return: *{Promise<Array>}*  Resolves with list of found errors.  \n\n### comb.processPath(path)\n\nProcess a file or a directory.\n\n- Params: *{String}*  Path to file or directory</td>\n- Return: *{Promise}*\n\n### comb.processDirectory(path)\n\nProcess all files in a directory.\n\n- Params: *{String}*  Path to directory\n- Return: *{Promise}*\n\n### comb.processFile(path)\n\nProcess a single file.\n\n- Params: *{String}*  Path to file\n- Return: *{Promise}*\n\n### comb.processString(string, options)\n\nProcess a string.\n\n- Params:  \n  *{String}*  Code to process  \n  *{{context: String, filename: String, syntax: String}}* Options (optional)\n  where *context* is\n  Gonzales PE rule, *filename* is a file's name that is used to display errors and\n  *syntax* is syntax name with `css` being a default value.  \n- Return: *{Promise<string>}*  Resolves with processed string.  \n\n## Writing a plugin\n\nA plugin is a JavaScript object that has methods to set value and process AST\nnodes.  \nTake a look at [Flip Comb](https://github.com/csscomb/core-template/blob/master/lib/options/flip-comments.js) for an example.  \nThere are some fields you should take care of.\n\n### name\n\nOption's name as it should be used in config.\n\n- Required: yes\n- Acceptable value: *{String}*\n- Example: `\"flip-comments\"`\n\n### syntax\n\nList of syntaxes the option supports.  \nThis depends on parser possibilities.  \nCurrently the following work fine: `css`, `less`, `sass` and `scss`.\n\n- Required: yes\n- Acceptable value: *{Array}*\n- Example: `['css']`\n\n### accepts\n\nIn order to tell CSScomb Core which values are acceptable, plugin should have\neither `accepts` or `setValue` field.  \n`accepts` should be used to provide patterns, while `setValue` is good for\nmodifying value before using it.\n\nYou can use one or several of the following:  \n– `boolean: [true]`  \n– `boolean: [false]`  \n– `boolean: [true, false]`  \n– `string: /regexp/`  \n– `number: true`\n\n- Required: no, but if this field is missed, `setValue` must be set\n- Acceptable value: *{Object}*\n- Example: `{ boolean: [true] }`\n\n### setValue\n\nFunction to modify option's value before using it.  \nThis field overrides `accepts` field if it's set in the plugin too.\n\n- Required: no, but if this field is missed, `accepts` must be set\n- Acceptable value: *{Function}*\n- Example: ` function(value) { return value * 4; }`\n\n### runBefore\n\nRun the plugin before another option.  \n\n- Required: no\n- Acceptable value: *{String}* Another option's name\n- Example: `\"block-indent\"`\n\n### process\n\nModify AST nodes.\n\n- Required: yes\n- Acceptable value: *{Function}*\n- Example: <pre><code>function(nodeType, nodeContent) {\n        if (nodeType === 'commentML') node[0] = ' (╯°□°）╯︵ ┻━┻ ';\n}</code></pre>\n","publish_time":1468274297044,"_cnpm_publish_time":1468274297044,"dist-tags":{"latest":"3.0.6"}}