{"maintainers":[{"name":"anonymous","email":"kpdecker@gmail.com"}],"keywords":["json parser whitespace comments configuration"],"dist-tags":{"latest":"1.2.0"},"description":"Accepting Language Config Environment","readme":"# ALCE\n\nAccepting Language Config Environment - \"Alice\"\n\nHuman friendly, machine editable, JSON-like config file format. Takes the JSON out of humans' nightmares.\n\nExtends JSON to allow for:\n\n- Comments\n- Regular expressions\n- Relaxed identifier and syntax handling\n\n## Example\n\n```javascript\n{\n  // Section 1. Global config\n  content: \"foo\",\n\n  // Section 2. Environment config\n  // WARN: A meaningful here be dragons comment\n  otherContent: [\n    // Note that trailing spaces and single quotes don't cause mass chaos\n    'see!',\n  ]\n}\n```\n\n## Usage\n\n```\nnpm install --save alce\n```\n\n```javascript\nvar ALCE = require('alce');\n\nvar config = ALCE.parse(configSource, {meta: true});\nconfig.set('key', 'new value');\nconfig.toString();\nconfig.toObject();\n```\n\n## API\n\n### ALCE.parse(configSource, options)\n\nParses a string containing a ACLE source file. Returns an ACLE object.\n\n- `configSource`: String representation of the configuration file\n- `options`: Options hash.\n  - `meta` : Set to truthy to return an editable version of the config that may be reconstructed. Falsy returns generic javascript object. See [#toObject](#toObject).\n  - Formatter options. See [Formatters](#formatters) for more info\n\n### ALCE.stringify(object, options)\n\nConverts a ACLE or javascript object to it's string representation.\n\n- `object`: Object to convert to a string\n- `options`: Formatter options when converting a javascript object. See [Formatters](#formatters) for more info.\n\n### Metadata Objects\n\n#### #get(id)\n\nReturns the ACLE or primitive value stored on the object under a given key. `undefined` if no key exists.\n\n#### #set(id, value)\n\nSets `value` to `id` converting to an ACLE object as necessary. If replacing an existing value, the formatting of that value will be maintained. If creating a new value, or child values, will use the rules defined in the `options` formatters.\n\n#### #remove(id)\n\nRemoves the key specified by `id`.\n\n#### Array-like methods\n\nACLE instances representing arrays additionally implement:\n\n- `length`\n- `push`\n- `pop`\n- `unshift`\n- `shift`\n- `splice`\n\nAll of which behave as they would if operating on an normal array.\n\n#### #toString()\n\nReturns the current config node contents in as close to the user's input format as possible.\n\n#### #toObject()\n\nReturns a generic javascript object with all config values stripped of any metadata. Useful for passing to other APIs or when metadata is not necessary.\n\n\n### Formatters\n\nFormatters control how newly created nodes are rendering. The may modify the `preamble`, `prologue`,\nand if applicable `innerPrologue`, fields on the new objects to control the formatting around the new object.\n\n\n### #seedIndent(parent, object)\n\nCalled for both parsed and new objects, allowing for the formatter to determine any state information necessary.\n\n```javascript\n  seedIndent: function(parent, object) {\n    if (parent) {\n      object.indent = exports.calcIndent(parent.preamble || '') + (parent.isArray ? '  ' : '');\n    } else {\n      object.indent = '';\n    }\n  },\n```\n\n#### #objectFormatter(parent, object)\n\nCalled when a new object or array is created. Generally `parent` will be an array instance or a property. The `isArray` field may be used to determine if `parent` or `object` is an array.\n\n```javascript\n  objectFormatter: function(parent, object) {\n    object.innerPrologue = '\\n' + object.indent;\n  },\n```\n\n#### #insertFormatter(parent, insert)\n\nCalled when a new value is inserted into an array or object instance. `insert` will be pushed to the end of the `parent.children` list after this operation occurs.\n\n```javascript\n  insertFormatter: function(parent, insert) {\n    var indent = parent.indent || ALCE.calcIndent(parent.preamble);\n    insert.preamble = (parent.children.length ? ',' : '') + '\\n  ' + indent;\n  },\n```\n\n#### #propertyFormatter(parent, property)\n\nCalled when a new property is created. This is useful for defining the `separator` value for a property.\n\n```javascript\n  propertyFormatter: function(parent, property) {\n    property.separator = ': ';\n  }\n```\n\n#### ALCE.TWO_SPACE_FORMATTER\n\nFormatter options that output two space indented data structures with trailing commas. May be passed directly into the `options` parameter for both `parse` and `serialize`.\n\n#### ALCE.calcIndent(preamble)\n\nUtilitity method for formatters. Determines the indentation that should be used for a node relative to a given prefix. This is helpful for the `inserFormatter` to determine where to align new children inserted into an object.\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/walmartlabs/alce/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","repository":{"type":"git","url":"git://github.com/kpdecker/alce.git"},"users":{"jbramesh":true,"dahjelle":true,"nethoncho":true,"mhaidarh":true},"bugs":{"url":"https://github.com/kpdecker/alce/issues"},"license":"MIT","versions":{"1.0.0":{"name":"alce","version":"1.0.0","description":"Accepting Language Config Environment","keywords":["json parser whitespace comments configuration"],"dependencies":{"esprima":"~1.0.4","estraverse":"~1.3.0"},"devDependencies":{"grunt":"~0.4.1","grunt-contrib-jshint":"~0.6.2","grunt-mocha-cov":"0.0.7","mocha":"~1.10.0","should":"~1.2.2"},"engines":{"node":">=0.8.0"},"main":"lib/alce.js","scripts":{"test":"./node_modules/.bin/mocha"},"_id":"alce@1.0.0","dist":{"shasum":"426184c98ee288d0eeac77fd63fed680b667cab6","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/alce/-/alce-1.0.0.tgz","integrity":"sha512-FT3U3Vn91ZzZ1REXrAO48cLc9Zwz1UloX9gCz7CDj8tC60TpmHJr4UzJchX9sMDFL6p0n02YGLYDslY+HSxMUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAD66Y9MwQ0UtBbyr0pg4EEHWur1V9WsuIgSboVTo6AWAiBffVaJKcJB4G1WnMBGpReZNP7tkN4yfsVRVmjIVs0eCw=="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"anonymous","email":"kpdecker@gmail.com"},"maintainers":[{"name":"anonymous","email":"kpdecker@gmail.com"}]},"1.1.0":{"name":"alce","version":"1.1.0","description":"Accepting Language Config Environment","keywords":["json parser whitespace comments configuration"],"dependencies":{"esprima":"1.2.x","estraverse":"1.5.x"},"devDependencies":{"grunt":"~0.4.1","grunt-contrib-jshint":"0.x.x","grunt-mocha-cov":"0.x.x","mocha":"1.x.x","should":"3.x.x"},"repository":{"type":"git","url":"git://github.com/walmartlabs/alce.git"},"engines":{"node":">=0.8.0"},"main":"lib/alce.js","scripts":{"test":"mocha"},"gitHead":"275548079dd9b403121005d9ef2b494d5b092484","bugs":{"url":"https://github.com/walmartlabs/alce/issues"},"homepage":"https://github.com/walmartlabs/alce","_id":"alce@1.1.0","_shasum":"fabc961c6e5cdc1892bd96ac0cb724d6fcf83f39","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"anonymous","email":"kpdecker@gmail.com"},"maintainers":[{"name":"anonymous","email":"kpdecker@gmail.com"}],"dist":{"shasum":"fabc961c6e5cdc1892bd96ac0cb724d6fcf83f39","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/alce/-/alce-1.1.0.tgz","integrity":"sha512-oOMTd5OSxX+VQdMNs43c5YCfmXJvLWr9Rl6uq88BgZrHohvNp0UNeZlotdXotOcGIt5Q+xcIP2Ri8j5L6MIqKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC91+z1Ljw1fNGoNTZ8x/5/MuOlGCYvWGcpUL2Qo6hgLAiEAoSlSqTEDR+jWtxHgzXSH2+LHuFF026Xwl57USJ1H+YU="}]}},"1.1.1":{"name":"alce","version":"1.1.1","description":"Accepting Language Config Environment","keywords":["json parser whitespace comments configuration"],"dependencies":{"esprima":"^1.2.0","estraverse":"^1.5.0"},"devDependencies":{"grunt":"~0.4.1","grunt-contrib-jshint":"0.x.x","grunt-mocha-cov":"0.x.x","mocha":"^2.0.0","should":"3.x.x"},"repository":{"type":"git","url":"git://github.com/kpdecker/alce.git"},"engines":{"node":">=0.8.0"},"main":"lib/alce.js","scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/kpdecker/alce/issues"},"homepage":"https://github.com/kpdecker/alce#readme","directories":{"test":"test"},"license":"MIT","gitHead":"fb96444576967b376e6f3b122b6f6ffadb402308","_id":"alce@1.1.1","_shasum":"fb303394ad5b5cf4c66daccecf8861a92aef9fea","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.1","_npmUser":{"name":"anonymous","email":"kpdecker@gmail.com"},"dist":{"shasum":"fb303394ad5b5cf4c66daccecf8861a92aef9fea","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/alce/-/alce-1.1.1.tgz","integrity":"sha512-T0Orhq94BrxblywWhKC1FHZChzzKKJg6Fot2io/pzsj9cZrRW1lTbgI/IcmW+/uv1IcYbPN0ldcH4Egne2T7AQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtFmXBYJ87j/xtYkKML5kA2u7IW2ZGbxhGr65aox6U3AiEAn0gixYTQsK0bkqdXhjRHIpal6BqlUWo7UjL6xyWpgn4="}]},"maintainers":[{"name":"anonymous","email":"kpdecker@gmail.com"}]},"1.2.0":{"name":"alce","version":"1.2.0","description":"Accepting Language Config Environment","keywords":["json parser whitespace comments configuration"],"dependencies":{"esprima":"^1.2.0","estraverse":"^1.5.0"},"devDependencies":{"grunt":"~0.4.1","grunt-contrib-jshint":"0.x.x","grunt-mocha-cov":"0.x.x","mocha":"^2.0.0","should":"3.x.x"},"repository":{"type":"git","url":"git://github.com/kpdecker/alce.git"},"engines":{"node":">=0.8.0"},"main":"lib/alce.js","scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/kpdecker/alce/issues"},"homepage":"https://github.com/kpdecker/alce#readme","directories":{"test":"test"},"license":"MIT","gitHead":"6c7057029d438e1a639769bc9a5a3e96c6bca766","_id":"alce@1.2.0","_shasum":"a8be2dacaac42494612f18dc09db691f3dea4aab","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.1","_npmUser":{"name":"anonymous","email":"kpdecker@gmail.com"},"dist":{"shasum":"a8be2dacaac42494612f18dc09db691f3dea4aab","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/alce/-/alce-1.2.0.tgz","integrity":"sha512-XppPf2S42nO2WhvKzlwzlfcApcXHzjlod30pKmcWjRgLOtqoe5DMuqdiYoM6AgyXksc6A6pV4v1L/WW217e57w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxXw9p72rgdeJjk0OcwOdOtg6FbO0SPw1RZ9ZUjxnjowIgDmScQsk91IxmvuvMohm7jEt6LbCPrJIlDTfTWEd3t8Q="}]},"maintainers":[{"name":"anonymous","email":"kpdecker@gmail.com"}]}},"name":"alce","time":{"modified":"2022-06-13T02:36:04.689Z","created":"2013-09-09T04:01:15.230Z","1.0.0":"2013-09-09T04:01:16.368Z","1.1.0":"2014-10-29T21:09:13.360Z","1.1.1":"2015-12-12T19:27:17.240Z","1.2.0":"2015-12-12T19:44:25.356Z"},"readmeFilename":"README.md","homepage":"https://github.com/kpdecker/alce#readme"}