{"name":"properties-parser","version":"0.6.0","description":"A parser for .properties files written in javascript","keywords":["parser",".properties","properties","java","file parser","actionscript"],"maintainers":[{"name":"xavi","email":"xavi.rmz@gmail.com"}],"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/xavi-/node-properties-parser.git"},"license":"MIT","engines":{"node":">= 0.3.1"},"scripts":{"test":"node test/test.js"},"dependencies":{},"gitHead":"948cfe3108a516db58d8c2c63635a7c74a0f5926","bugs":{"url":"https://github.com/xavi-/node-properties-parser/issues"},"homepage":"https://github.com/xavi-/node-properties-parser#readme","_id":"properties-parser@0.6.0","_nodeVersion":"18.12.1","_npmVersion":"9.3.0","dist":{"integrity":"sha512-qvr2cSmoA0dln0MARAKwBzPkkXn7FqwX+RVVNpMdMJc7rt9mqO2cXwluxtux9fHrLhjnPFaQkS8BM0kFrTCnSw==","shasum":"0cd36c26e76c9a75222e258e89ee0c663cd3658c","tarball":"http://registry-npm.ywwl.com/properties-parser/download/properties-parser-0.6.0.tgz","fileCount":7,"unpackedSize":23821,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLQ4JxDTol6MRpEPLuj5UUjNQkUYoc+im9zP9gRj2avAiBn23/vBa0N0ZJIRlrCMEmrPpSubDTMT2A/HluBJHEupA=="}],"size":6857,"noattachment":false,"key":"/properties-parser/-/properties-parser-0.6.0.tgz"},"_npmUser":{"name":"xavi","email":"xavi.rmz@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/properties-parser_0.6.0_1685067945970_0.39560482158240173"},"_hasShrinkwrap":false,"readme":"# node-properties-parser\n\nA parser for [.properties](http://en.wikipedia.org/wiki/.properties) files written in javascript.  Properties files store key-value pairs.  They are typically used for configuration and internationalization in Java applications as well as in Actionscript projects.  Here's an example of the format:\n\n```properties\n# You are reading the \".properties\" entry.\n! The exclamation mark can also mark text as comments.\nwebsite = http://en.wikipedia.org/\nlanguage = English\n# The backslash below tells the application to continue reading\n# the value onto the next line.\nmessage = Welcome to \\\n\t\t\tWikipedia!\n# Add spaces to the key\nkey\\ with\\ spaces = This is the value that could be looked up with the key \"key with spaces\".\n# Unicode\ntab : \\u0009\n```\n*(taken from [Wikipedia](http://en.wikipedia.org/wiki/.properties#Format))*\n\n## The API\n\n- `parse(text)`: Parses `text` into key-value pairs.  Returns an object containing the key-value pairs.\n- `read(path[, callback])`: Opens the file specified by `path` and calls `parse` on its content.  If the optional `callback` parameter is provided, the result is then passed to it as the second parameter.  If an error occurs, the error object is passed to `callback` as the first parameter. If `callback` is not provided, the file specified by `path` is synchronously read and calls `parse` on its contents.  The resulting object is immediately returned.\n- `createEditor([path][, options][, callback]])`:  If neither `path` or `callback` are provided an empty editor object is returned synchronously.  If only `path` is provided, the file specified by `path` is synchronously read and parsed.  An editor object with the results in then immediately returned.  If both `path` and `callback` are provided, the file specified by `path` is read and parsed asynchronously.  An editor object with the results are then passed to `callback` as the second parameters.  If an error occurs, the error object is passed to `callback` as the first parameter.  The following options are supported:\n\t- `options.separator`: The character used to separate key/values.  Defaults to \"=\".\n\t- `options.path`: Treated the same way as the optional `path` argument.  If both are provided the argument wins.\n\t- `options.callback`: Treated the same way as the optional `callback` parameter.  If both are provided the argument wins.\n- `editorFromString(text[, options])`: creates an `Editor` object from the text string passed in\n- `Editor`: The editor object is returned by `createEditor`.  Has the following API:\n\t- `get(key)`: Returns the value currently associated with `key`.\n\t- `set(key, [value[, comment]])`: Associates `key` with `value`. An optional comment can be provided. If `value` is not specified or is `null`, then `key` is unset.\n\t- `unset(key)`: Unsets the specified `key`.\n\t- `save([path][, callback]])`: Writes the current contents of this editor object to a file specified by `path`.  If `path` is not provided, then it'll be defaulted to the `path` value passed to `createEditor`.  The `callback` parameter is called when the file has been written to disk.\n\t- `addHeadComment`: Added a comment to the head of the file.\n\t- `toString`: Returns the string representation of this properties editor object.  This string will be written to a file if `save` is called.\n\n## Getting properties-parser\n\nThe easiest way to get node-properties-parser is with [npm](https://www.npmjs.com/package/properties-parser):\n\n\tnpm install properties-parser\n\nAlternatively you can clone this git repository:\n\n\tgit://github.com/xavi-/node-properties-parser.git\n\nFor type definitions use [npm](https://www.npmjs.com/package/@types/properties-parser):\n\n\tnpm install --save @types/properties-parser\n\n## Developed by\n\n* Xavi Ramirez\n\n## License\n\nThis project is released under [The MIT License](http://www.opensource.org/licenses/mit-license.php).\n","publish_time":1685067946152,"_cnpm_publish_time":1685067946152,"dist-tags":{"latest":"0.6.0"}}