{"_id":"varstream","_rev":"27-4a678dec904e9665ffa6c271cf883571","name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.1":{"name":"varstream","description":"Stream variables beetween client/server.","version":"0.1.1","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":"*"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./VarStream","_id":"varstream@0.1.1","dist":{"shasum":"328f0833525ffb255d1463891034d0831cd5104f","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.1.1.tgz","integrity":"sha512-MklCTw3+NX8te5FXXaKR6raR3/LGe7uzB8FmjctskdstU6z8bbeuVeaB6lqO/3m+Scr83JQ+4XlCzSXszfq+PA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCllAU0YhtsMIfOC5gh1OnSJemsHNrljM/n/vfFgSr4FQIgI1a25Klh5ticSIdf+dGGJP9uwfQXeL/pF3DzRm6LURM="}]},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"directories":{}},"0.1.2":{"name":"varstream","description":"Stream variables beetween client/server.","version":"0.1.2","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":"*"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./VarStream","_id":"varstream@0.1.2","dist":{"shasum":"ee5686475ff5087149e6540ffa14db4069008849","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.1.2.tgz","integrity":"sha512-tlUGvxK+5X22fA3cVJJqc9tbNxeoa1Up/g76DOxnM69YYmttfHswoWaI9kPWOko1MChved5zd41uz2HzqCUxkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICqxqOyjugFjOk7ZmcPfYXu9Kv+Lna/fQl804893aNxsAiBNZRy5pw9mFSpwzxwk5Mm8E3htDrGDTrxglLkrClYG2Q=="}]},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}]},"0.2.0":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.2.0","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{},"devDependencies":{"mocha":"~1.7.0"},"scripts":{"test":"mocha tests/*.mocha.js"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.2.0","dist":{"shasum":"b4d2c59ffb94e49a2ea0e2ae07e12812596fccc9","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.2.0.tgz","integrity":"sha512-ApT6DJVoeVbZWZl+Gf+iDzaMx6ZD7646qOUOqUMImUg6BogQWrjj/2pnKVaxdU5Sj1LvVrpVzAkUOr/AbYbR5w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/0oXGCuVtUGneGO0egS5C/7+inZjGum1pTRxAgO9z1gIgKhWmTDVgPJRJuWrEPcKhU2t81UJRuXvfiNzlkOxjJmU="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}]},"0.2.1":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.2.1","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{},"devDependencies":{"mocha":"~1.7.0"},"scripts":{"test":"mocha tests/*.mocha.js"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.2.1","dist":{"shasum":"6caa29bd41516fda59fbc50613b4c70f11a7368d","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.2.1.tgz","integrity":"sha512-Sy2skbdQ7xnNyJj3Tuz2y2sS3o+pupANa/1PaMbFRn8hl4dIuPe7tXGMCmJXJwvlTRjFooboUbJyHbWQTIWC1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh2a+IwocdnHiZMf3XXO8d8DJEr/oWVGD0dsIaNSNNggIgRgMuXXKfJ+yx7K0zraQTkbsjocWVG5mJFwnDZPdo4cM="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}]},"0.2.2":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.2.2","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{},"devDependencies":{"mocha":"~1.7.0"},"scripts":{"test":"mocha tests/*.mocha.js"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.2.2","dist":{"shasum":"3956bb82be5c30b68fa5e2b915611912edd1a093","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.2.2.tgz","integrity":"sha512-G0ri7sa1Cxz/UwS6KKfDqv4wwoqHqGomhe4YuQ3KxoCmkz1roZ7Tyj1uiWPN19JzbQ+FzrqQLz4Lk72oldki6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdDRscoz55TXNP+x5p0wt2CJiAOSAghKmMNyD1N6RqMgIgMXbeMoMu8vqJUpXMPL6VnubzQA0pPY564heBX8IQhH0="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}]},"0.2.3":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.2.3","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{},"devDependencies":{"mocha":"~1.7.0"},"scripts":{"test":"mocha tests/*.mocha.js"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.2.3","dist":{"shasum":"4a2a6a1fabf207e2f548f0f89ba6b1d45bb52d2a","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.2.3.tgz","integrity":"sha512-+NChwoOys8goFYVohIKbt/kvqMntcXCtlXSY26xKEwGSn6L50vitcCl1Ru//te/JuFCTpacM4Q9La79n2jLgBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTAAWZ7OINVpsAofWrmpyYXaQFsS0LDEpX3RE68QaDaQIhAO0kMi4lIgPDf6WV3lI6jGR06h7pLwNCq59C5J9wtq42"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}]},"0.2.4444":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.2.4444","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{},"devDependencies":{"mocha":"~1.7.0"},"scripts":{"test":"mocha tests/*.mocha.js"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.2.4444","dist":{"shasum":"cc91808fba551341b1223f833e5d647f6daf39c2","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.2.4444.tgz","integrity":"sha512-iKb0PpQ+DyQxqo82mWz6Hk0X5A+ZV+B0FaBurRi8JCpEz6lVWVaVi6XJZUYMPX552Ttnf4ygu4lwcpNDv+hSqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH2A4WwzzvbhkmuGLOvqClJ58bYWAKd+1YCUNgRRj6/gCIQDHfWKN7EGKNTavrrHRTtgFAoNN3CzHivCGN9w2M6U0YQ=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}]},"0.3.0":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.3.0","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{"readable-stream":"^1.0.26-2"},"devDependencies":{"mocha":"~1.18.2","mocha-lcov-reporter":"0.0.1","coveralls":"~2.10.0","istanbul":"~0.2.6"},"scripts":{"test":"node_modules/mocha/bin/mocha tests/*.mocha.js","coveralls":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","cover":"./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"gitHead":"2440e646e47cb9ef5ea13fabc9c6fb2a9e8838cf","bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.3.0","_shasum":"0599bb1d9f815ae96e7f50882d3f2871a712d76f","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"dist":{"shasum":"0599bb1d9f815ae96e7f50882d3f2871a712d76f","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.3.0.tgz","integrity":"sha512-Ir8Dnaek/4QcOe9I1rdK4b4EDPcPwzhF3TjENpYPlyaU2IDHHjcCpR3LSu1Voa8mdDE4kGCB2pIs061N8Wzn4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+XA+MDL5fjKcyqRUvOW5IKu+RnAdN3N4IhInDv/TE3AIhAMDCRCgOTcwRPit/L6cKQ/U2i+NBrJHKd5dUf41DV4tM"}]}},"0.3.1":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.3.1","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{"readable-stream":"^1.0.33"},"devDependencies":{"mocha":"~2.1.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.11.2","istanbul":"~0.3.5"},"scripts":{"test":"node_modules/mocha/bin/mocha tests/*.mocha.js","coveralls":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","cover":"./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"gitHead":"dc62f0046ed47f4942d515bc1b9b524a3bf600ab","bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.3.1","_shasum":"b8c4deee8a64ffaaf8cf890c196c3c24f69c912d","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"dist":{"shasum":"b8c4deee8a64ffaaf8cf890c196c3c24f69c912d","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.3.1.tgz","integrity":"sha512-tpXX6UA4gdUXOt7jNlNM9/bZYIAO+PQxgIfa3GPXwhnjfEjUoJe+/yDew35wbMY80agtXvDEx9ZqvL3meQqhdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFM5ShaGlpc/Qi+8sZQfoG24A38uFYZ/sWok+y+Ten1wAiBmz2Mb8nZucxN2Ei04hha0vqI7EFjYm9yMvfx2Q0YVtA=="}]}},"0.3.2":{"name":"varstream","description":"Stream variables beetween 2 JavaScript threads (client/server, ipc, worker/main thread).","version":"0.3.2","author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"engines":{"node":">=0.10.*"},"dependencies":{"readable-stream":"^1.0.33"},"devDependencies":{"mocha":"~2.1.0","mocha-lcov-reporter":"0.0.1","coveralls":"~2.11.2","istanbul":"~0.3.5"},"scripts":{"test":"node_modules/mocha/bin/mocha tests/*.mocha.js","coveralls":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","cover":"./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000"},"keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"main":"./src/VarStream","preferGlobal":"true","bin":{"varstream2json":"cli/varstream2json.js","json2varstream":"cli/json2varstream.js"},"gitHead":"87310ad6fc46a99c2ea61eab6a8025b94cb2dbc3","bugs":{"url":"https://github.com/nfroidure/VarStream/issues"},"homepage":"https://github.com/nfroidure/VarStream","_id":"varstream@0.3.2","_shasum":"18ac6494765f3ff1a35ad9a4be053bec188a5de1","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"dist":{"shasum":"18ac6494765f3ff1a35ad9a4be053bec188a5de1","tarball":"https://registry.npmjs.org/varstream/-/varstream-0.3.2.tgz","integrity":"sha512-OpR3Usr9dGZZbDttlTxdviGdxiURI0prX68+DuaN/JfIDbK9ZOmREKM6PgmelsejMnhgjXmEEEgf+E4NbsSqMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW1H+fzlK4SKz6AN5uED0wIb32iECtetyLVfwTq8q1oQIgErngatP42wgTx5VjPzp5tO/wnearsBKGaqhKiYqjC+E="}]}}},"readme":"# VarStream\r\n> VarStream is a data storage and exchange format.\r\n\r\n[![NPM version](https://badge.fury.io/js/varstream.png)](https://npmjs.org/package/varstream) [![Build status](https://secure.travis-ci.org/nfroidure/VarStream.png)](https://travis-ci.org/nfroidure/VarStream) [![Dependency Status](https://david-dm.org/nfroidure/VarStream.png)](https://david-dm.org/nfroidure/VarStream) [![devDependency Status](https://david-dm.org/nfroidure/VarStream/dev-status.png)](https://david-dm.org/nfroidure/VarStream#info=devDependencies) [![Coverage Status](https://coveralls.io/repos/nfroidure/VarStream/badge.png?branch=master)](https://coveralls.io/r/nfroidure/VarStream?branch=master)\r\n\r\nVarStream :\r\n* is human readable/writeable : no need to be a programmer to create VarStreams.\r\n* is streamable : No need to wait the datas to be fully loaded to\r\n populate/access your program variables.\r\n* keeps backward references: you can refer to another variable of the stream\r\n in the stream itself.\r\n* merges with no loss: you can easily merge multiple varstreams.\r\n* is light: due to it's smart optimizations and syntax sugar.\r\n* is memory efficient: the garbage collector can cleanup memory before the parse\r\n ends, backward references prevent data duplication.\r\n* accept comments: keep your configuration/localization files readable.\r\n* loves circular references: transmit your variable trees with no hack.\r\n\r\n## Use cases\r\n\r\n### Smarter configuration files\r\nVarStream allows you to configure your projects in a clear and readable way.\r\n Since VarStream is merge friendly, it is particularly usefull for loading\r\n multilevel configuration files without erasing previously set contents.\r\n\r\nImagine this sample configuration file:\r\n\r\n```\r\n# Server\r\nserver.domain=example.com\r\nserver.protocols.+=http\r\nserver.protocols.+=https\r\nserver.databases.+.host=db1.example.com\r\nserver.databases.*.username=db1\r\nserver.databases.+.host=db2.example.com\r\nserver.databases.*.username=db2\r\nserver.cache.size=2048\r\n# HTML document\r\ndocument.scripts.+.uri=//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\r\ndocument.scripts.+.uri=//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js\r\n```\r\n\r\nYou could easily override some of its contents by loading this specific\r\n configuration file next to him:\r\n\r\n```\r\n# Append my custom dev TLD\r\nserver.domain+=.local\r\n# Support 1 more protocol\r\nserver.protocols.+=ws\r\n# Reset DB and set my local one\r\nserver.databases.!.host=localhost\r\nserver.databases.*.username=db1\r\n# Increase cache size (8 times)\r\nserver.cache.size*=8\r\n# Use local scripts\r\ndocument.scripts.0.uri=javascript/jquery.js\r\ndocument.scripts.1.uri=javascript/jquery-ui.js\r\n```\r\n\r\nThe same goes for internationalization files. You could load a language file and\r\n augment it with a locale file.\r\n\r\n### Sharing variable trees in realtime\r\nVarStreams particularly suits with the JavaScript messaging systems. Communicate\r\n through different JavaScript threads (or over the Network) has never been so\r\n simple.\r\n\r\nThis is particularly usefull for data driven applications.\r\n\r\n## Test it !\r\n* [draw content before its full load](http://server.elitwork.com/experiments/pagestream/index.html).\r\n* [loading charts progressively](http://server.elitwork.com/experiments/chartstream/index.html).\r\n* [maintain a variable tree beetween many processes with web sockets](https://github.com/nfroidure/WebSockIPC).\r\n* claim yours !\r\n\r\n## Performances\r\nCompared to JSON, VarStreams brings nice formatting with often less weight.\r\n* test1 : linear.dat [390 bytes] vs linear.json [423 bytes] => 8% smaller\r\n* test2 : arrays.dat [1244 bytes] vs arrays.json [1178 bytes] => 6% bigger\r\n* test3 : references.dat [2844 bytes] vs references.json [3314 bytes] => 16% smaller\r\n\r\n## How to use\r\nWith NodeJs :\r\n```js\r\n// Synchronous API\r\nvar cnt = fs.ReadFileSync('test2.dat', {encoding: 'utf-8'});\r\n// Parse VarStream content\r\nvar obj = VarStream.parse(cnt);\r\n// Get an Object content as a VarStream\r\ncnt = VarStream.stringify(obj);\r\n\r\n// Streaming\r\nvar VarStream = require('varstream');\r\nvar fs = require('fs');\r\n\r\nvar scope = {}; // The root scope\r\nvar myVarStream=new VarStream(scope, 'prop');\r\n// Reading var stream from a file\r\nfs.createReadStream('test.dat').pipe(myVarStream)\r\n  .on('end', function () {\r\n  // Piping VarStream to a file\r\n\tmyVarStream.pipe(fs.createWriteStream('test2.dat'));\r\n\t});\r\n```\r\n\r\nIn the browser, you can use browserify or directly VarStreamReader and\r\n VarStreamWriter constructors.\r\n\r\n## CLI Usage\r\nVarStream comes with two CLI utilities, to use them, install VarStream globally:\r\n```sh\r\nnpm install -g varstream\r\n# Convert JSON datas to VarStream\r\njson2varstream path/to/input.json > path/to/ouput.dat\r\n# Convert VarStreams datas to JSON\r\nvarstream2json path/to/input.dat > path/to/ouput.json\r\n```\r\n\r\n## Contributing/Testing\r\nThe VarStream JavaScript library is fully tested. If you want to contribute,\r\n test your code before submitting, just run the following command with\r\n NodeJS dependencies installed :\r\n```js\r\nnpm test\r\n```\r\n\r\n## Contributors\r\n* Nicolas Froidure - @nfroidure\r\n\r\n## License\r\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>\r\n","maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"time":{"modified":"2022-06-28T09:10:10.417Z","created":"2012-07-09T13:14:54.328Z","0.1.1":"2012-07-09T13:14:56.517Z","0.1.2":"2012-08-17T08:38:09.325Z","0.2.0":"2013-12-03T09:17:41.839Z","0.2.1":"2013-12-12T13:06:28.473Z","0.2.2":"2014-01-09T13:23:32.320Z","0.2.3":"2014-01-10T14:59:40.856Z","0.2.4444":"2014-02-01T20:47:11.296Z","0.3.0":"2014-12-15T14:42:10.476Z","0.3.1":"2015-01-27T13:53:13.956Z","0.3.2":"2015-01-27T14:34:22.621Z"},"author":{"name":"Nicolas Froidure"},"repository":{"type":"git","url":"http://github.com/nfroidure/VarStream.git"},"readmeFilename":"README.md","homepage":"https://github.com/nfroidure/VarStream","keywords":["variable","file","stream","json","ipc","pipe","format","read","write","localization","configuration"],"bugs":{"url":"https://github.com/nfroidure/VarStream/issues"}}