{"_id":"json-concat","_rev":"10-ece8a4c25bc768e528f2d104fc62697c","name":"json-concat","description":"concatenate json files and objects","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0-alpha":{"name":"json-concat","version":"0.0.0-alpha","description":"concatenate json files and objects","homepage":"https://github.com/GochoMugo/json-concat","license":"MIT","repository":{"type":"git","url":"https://github.com/GochoMugo/json-concat.git"},"bugs":{"url":"https://github.com/GochoMugo/json-concat/issues"},"keywords":["json","concat","concatenate","express","connect","terminal"],"author":{"name":"Gocho Mugo","email":"mugo@forfuture.co.ke","url":"https://twitter.com/Mugo_Gocho"},"main":"json-concat.js","dependencies":{},"bin":{"json-concat":"./cmd.js"},"_id":"json-concat@0.0.0-alpha","dist":{"shasum":"43f2ca5de4eec069f839e02988289756df32eacb","tarball":"https://registry.npmjs.org/json-concat/-/json-concat-0.0.0-alpha.tgz","integrity":"sha512-DVcHaRhTAxLRmpJuTBLplMFl7RSytw3FrDbQCHUX3F854P3XaIkUA4ylOEBlVjzFJEWHFKTgtiVKQD8oKP5aWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3oFHugL8rSw1luzLDs3mrH54wbODrXoKIG1Vr88Ny3gIhAJjIa4qU7UqnpgrRTSC/d5TZbgUx/GOlvmV6zwH6Ok2Y"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"gochomugo","email":"gochomugo.developer@gmail.com"},"maintainers":[{"name":"gochomugo","email":"gochomugo.developer@gmail.com"}]},"0.0.0-alpha.1.0":{"name":"json-concat","version":"0.0.0-alpha.1.0","description":"concatenate json files and objects","homepage":"https://github.com/GochoMugo/json-concat","license":"MIT","repository":{"type":"git","url":"https://github.com/GochoMugo/json-concat.git"},"bugs":{"url":"https://github.com/GochoMugo/json-concat/issues"},"keywords":["json","concat","concatenate","express","connect","terminal"],"author":{"name":"Gocho Mugo","email":"mugo@forfuture.co.ke","url":"https://twitter.com/Mugo_Gocho"},"main":"json-concat.js","dependencies":{},"bin":{"json-concat":"./cmd.js"},"_id":"json-concat@0.0.0-alpha.1.0","dist":{"shasum":"c9bfb01011206fe76be5351fb32c4ac18e03bba2","tarball":"https://registry.npmjs.org/json-concat/-/json-concat-0.0.0-alpha.1.0.tgz","integrity":"sha512-A0wQJ+2bGSPImj9feupU7wuRFJMF2ZcUGPWYqCSfj35JdtPYEJ4rUUZFNPV18Fotv8M+2/FzZGZpXxTx+ZRxjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsxxqJvWL0chLdDTrzirWgV2lqvoXe9QTi85okx5ZZ2gIhAOaR6mOIC36+iYHESwdHPjsKqVwoAbnQzdgyUG82ldBG"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"gochomugo","email":"gochomugo.developer@gmail.com"},"maintainers":[{"name":"gochomugo","email":"gochomugo.developer@gmail.com"}]},"0.0.0":{"name":"json-concat","version":"0.0.0","description":"concatenate json files and objects","homepage":"https://github.com/GochoMugo/json-concat","license":"MIT","repository":{"type":"git","url":"https://github.com/GochoMugo/json-concat.git"},"bugs":{"url":"https://github.com/GochoMugo/json-concat/issues"},"keywords":["json","concat","concatenate","express","connect","terminal"],"author":{"name":"GochoMugo","email":"mugo@forfuture.co.ke","url":"https://github.com/GochoMugo"},"main":"json-concat.js","dependencies":{},"devDependencies":{"grunt":"~0.4.5","grunt-contrib-coffee":"~0.13.0","grunt-contrib-copy":"~0.8.0","grunt-mocha-test":"~0.12.7","istanbul":"~0.3.8","lodash":"~3.5.0","shelljs":"~0.3.0","should":"~5.2.0"},"bin":{"json-concat":"./cmd.js"},"scripts":{"test":"grunt test"},"_id":"json-concat@0.0.0","_shasum":"1838cdf680741716bd634b9d778ef835e94e0f97","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"gochomugo","email":"mugo@forfuture.co.ke"},"maintainers":[{"name":"gochomugo","email":"gochomugo.developer@gmail.com"}],"dist":{"shasum":"1838cdf680741716bd634b9d778ef835e94e0f97","tarball":"https://registry.npmjs.org/json-concat/-/json-concat-0.0.0.tgz","integrity":"sha512-gNwMXqmPVX5hzjZbrBJo8x7l902aMUlDjtN4ZqcovjrE12jCCAJHXkhCxSzq08a6WcydeZSQ739nNimZY0SRYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXf5kZZR5lTYfxcFp2yb2PSk4GpPJfK55o9/h/+Ih7FgIgDha99Fc1xkVnA7bsgs/EDAFORriV2xGUKdzNt5AE4Ak="}]}},"0.0.1":{"name":"json-concat","version":"0.0.1","description":"concatenate json files and objects","homepage":"https://github.com/GochoMugo/json-concat","license":"MIT","repository":{"type":"git","url":"git+https://github.com/GochoMugo/json-concat.git"},"bugs":{"url":"https://github.com/GochoMugo/json-concat/issues"},"keywords":["json","concat","concatenate","express","connect","terminal"],"author":{"name":"GochoMugo","email":"mugo@forfuture.co.ke","url":"https://github.com/GochoMugo"},"main":"lib/json-concat.js","dependencies":{},"devDependencies":{"grunt":"^0.4.5","grunt-cli":"^0.1.13","grunt-contrib-clean":"^1.0.0","grunt-contrib-coffee":"^1.0.0","grunt-contrib-copy":"^0.8.0","grunt-mocha-test":"^0.12.7","istanbul":"^0.4.2","lodash":"^4.5.1","shelljs":"^0.6.0","should":"^8.2.2"},"bin":{"json-concat":"./bin/json-concat"},"scripts":{"test":"grunt test"},"gitHead":"41ca05d16c12b73b5825907dea0155b22c77c218","_id":"json-concat@0.0.1","_shasum":"4f6303c9cac94eba30bbff91d13abea0118c97e2","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"gochomugo","email":"mugo@forfuture.co.ke"},"dist":{"shasum":"4f6303c9cac94eba30bbff91d13abea0118c97e2","tarball":"https://registry.npmjs.org/json-concat/-/json-concat-0.0.1.tgz","integrity":"sha512-clK755bwGKlpRESYivScHgyaMV+aChahmbywnpACF8CEECgtXFAh9dWuym7h0FwlyawjldN80uEXf9BcxeKVPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6jq5AY3enTEbBGaM5cRUAQn1RUuXzZPA2XR1TbTAfXwIhAIxseTIlPt4sp6r61UL7vTJjVWFV1EV6XmN6z72Ybnsw"}]},"maintainers":[{"name":"gochomugo","email":"gochomugo.developer@gmail.com"}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/json-concat-0.0.1.tgz_1456303316795_0.962161568691954"}}},"readme":"\n# json-concat\n\nA [Node.js][nodejs] module for concatenating JSON files and objects. Use it in\nNode.js as a __plain, old module__, in [Connect][connect] and [Express][express]\nas a __middleware__ and in your terminal as an __executable__.\n\n\n## Installation\n\n```bash\n$ npm install json-concat --save\n```\n\nTo install json-concat onto your command line, you may require passing the\n`-g` flag. You may also require some `sudo` powers to make it work.\n\n```bash\n$ sudo npm install -g json-concat\n```\n\n\n## Usage\n\n### As a plain module in your apps\n\n```js\n\nvar jsonConcat = require(\"json-concat\");\n\njsonConcat({\n    src: [\"appVars.json\", \"userVars.json\"],\n    dest: \"./config.json\"\n}, function (json) {\n    console.log(json);\n});\n\n```\n\n### As a middleware in Connect/Express apps\n\n```js\n\nvar express    = require(\"express\"),\n    app        = express(),\n    jsonConcat = require(\"json-concat\");\n\napp.use(jsonConcat({\n    src: [\"appVars.json\", \"userVars.json\"],\n    dest: __dirname + \"/config.json\",\n    middleware: true\n}));\n\n```\n\n### As an executable in the command line\n\n```bash\n# As simple as this. Output file should be last\n$ json-concat file1.json file2.json ouput.json\n\n# for usage tip, invoke with no args\n$ json-concat\n```\n\n\n## Notes\n\n* The options object passed may have the following keys:\n    * **src**:\n        * (String) path pointing to a directory\n        * (Array) array of paths pointing to files and/or directories\n        * defaults to `.` (current working directory)\n        * **Note:** if this is a path points to a single file, nothing will be done.\n    * **dest**:\n        * (String) path pointing to a file in which the JSON output will be written to\n        * (Null) assign `null` to have **no** file written to\n        * defaults to `./concat.json`\n    * **middleware**:\n        * (Boolean) whether it is being used as a middleware or not\n        * defaults to `false`\n* The **callback** receives two arguments:\n    * **err**:\n        * An error object if an error does occur\n    * **json**:\n        * On Sucess, the concatenated json is passed\n        * On error, the json will be an empty string `\"\"`\n* In Connect/Express apps, the concatenation is done on **server requests**\n* It is **asynchronous**, the Node.js way\n* It is **forgiving**, keeps going even when an error occurs. For example, a non-existent file or syntax errors in json files\n* It is **recursive**, following the folders specified. Files with the extension `.json` are considered. Symbolic links are ignored\n\n\n## Use Cases\n\nIn most cases, while building an Express app, you will end up using\n[jade][jade] as your view engine. Jade allows you to pass a javascript\nobject, which may be JSON, for external variables. Instead of writing all\nyour variables in one file, you may distribute the variables across\ndirectories and concatenate them later into one file. Eventually passing\nit to the jade engine.\n\n\n## Tests and Performance\n\n[![Build Status](https://travis-ci.org/GochoMugo/json-concat.svg?branch=master)][ci] [![Coverage Status](https://coveralls.io/repos/GochoMugo/json-concat/badge.svg)](https://coveralls.io/r/GochoMugo/json-concat)\n\nTo see the tests run on each commit, go to the [project's Travis page][ci].\nIf interested in the algorithms used, please read the notes at the beginning\nof [src/json-concat.coffee][main_file].\n\n\n## TODO\n\n- [x] Include tests (v0.0.0)\n- [ ] Allow Synchronous Execution: be called as a function with splats\n\n```js\n\n// Just an example\nvar json = jsonConcat(\"appVars.json\", \"userVars.json\", {\"name\": \"@mugo_gocho\"});\nconsole.log(json);\n\n```\n\n- [ ] Get the JSON output in a pretty format i.e. with indentations\n\n\n## License\n\n**The MIT License (MIT)**\n\n**Copyright &copy; 2014-2016 GochoMugo <mugo@forfuture.co.ke>**\n\n\n[ci]:https://travis-ci.org/GochoMugo/json-concat\n[coffee]:https://coffeescript.org\n[connect]:https://senchalabs.github.com/connect\n[express]:https://expressjs.com\n[jade]:https://jade-lang.com\n[main_file]:https://github.com/GochoMugo/json-concat/blob/master/src/json-concat.coffee\n[mit]:https://opensource.org/licenses/MIT\n[nodejs]:https://nodejs.org\n","maintainers":[{"name":"gochomugo","email":"gochomugo.developer@gmail.com"}],"time":{"modified":"2022-06-19T06:13:04.607Z","created":"2014-09-01T22:18:31.088Z","0.0.0-alpha":"2014-09-01T22:18:31.088Z","0.0.0-alpha.1.0":"2014-09-02T03:42:55.059Z","0.0.0":"2015-03-16T00:55:53.631Z","0.0.1":"2016-02-24T08:41:59.350Z"},"homepage":"https://github.com/GochoMugo/json-concat","keywords":["json","concat","concatenate","express","connect","terminal"],"repository":{"type":"git","url":"git+https://github.com/GochoMugo/json-concat.git"},"author":{"name":"GochoMugo","email":"mugo@forfuture.co.ke","url":"https://github.com/GochoMugo"},"bugs":{"url":"https://github.com/GochoMugo/json-concat/issues"},"license":"MIT","readmeFilename":"README.md","users":{"barreiros":true}}