{"bugs":{"url":"https://github.com/pvorb/jsml/issues"},"dist":{"shasum":"699b3875c11bf929f5d0b472d0c1874e5bab0edf","tarball":"https://registry.npmjs.org/jsml/-/jsml-0.1.0.tgz","integrity":"sha512-Nh8zVY7G6181uTZfllPFRhznPJbHuVyYyZB0yoBqJxYrqzz9g/IkRyGAKyuBK8cYZULydy0pEFaz3yk2I/fwXw==","signatures":[{"sig":"MEQCIDItnEyesd/2CTHhwX5XVJXFH/XGHdHYu21yOeBwGsWXAiBHxjGFl31Voph4j9Loczw1mEAIJyxenFrxttnnvB60mw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./jsml.js","name":"jsml","tags":["json","yaml","markup language"],"author":{"url":"http://paul.vorba.ch/","name":"Paul Vorbach","email":"paul@vorb.de"},"readme":"JSML\n====\n\nAppendable sequences of JSON documents\n\nThere’s an issue with JSON that I can’t tolerate: If you want to add a new\nobject to a JSON document, you have to rewrite the whole document. That makes it\ninappropriate for logging an similar tasks. This is where JSML pitches in.\n\nExample\n-------\n\nHere’s an example document that defines metadata for serveral articles:\n\n``` javascript\n{\n  \"title\": \"Hello World\",\n  \"date\":  \"2012-08-09\",\n  \"tags\":  [ \"hello world\", \"misc\" ]\n}\n---\n{\n  \"title\": \"The second article\",\n  \"date\":  \"2012-08-10\",\n  \"tags\":  [ \"misc\" ]\n}\n```\n\nNote that each object is a normal JSON representation of a JavaScript object.\nIn JSON itself, the same document would look like this:\n\n``` javascript\n[\n  {\n    \"title\": \"Hello World\",\n    \"date\": \"2012-08-09\",\n    \"tags\": [ \"hello world\", \"misc\" ]\n  },\n  {\n    \"title\": \"The second article\",\n    \"date\":  \"2012-08-10\",\n    \"tags\":  [ \"misc\" ]\n  }\n]\n```\n\nSo the only difference from a usual JSON document is, that objects in top level\narrays are separated by `---` on a distinct line.\n\nInstallation\n------------\n\n```\nnpm install jsml\n```\n\nor\n\n```\nender build jsml\n```\n\nUsage\n-----\n\nYou can use JSML just like [JSON](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON):\n\n``` javascript\nvar JSML = require('jsml');\n\nvar jsmlDocument = '{ \"title\": \"Hello World\",\\n'\n                 + '\"date\":  \"2012-08-09\",\\n'\n                 + '\"tags\":  [ \"hello world\", \"misc\" ] }\\n'\n                 + '---\\n'\n                 + '{ \"title\": \"The second article\",\\n'\n                 + '\"date\":  \"2012-08-10\",\\n'\n                 + '\"tags\":  [ \"misc\" ] }\\n';\n\n// Parse a string\n\nvar doc = JSML.parse(jsmlDocument);\n\nconsole.log(doc);\n\n// Stringify an Object or an Array of Objects\n\nvar jsmlString = JSML.stringify(doc, null, '  ');\n\nconsole.log(jsmlString);\n```\n\nThis will print:\n\n``` javascript\n[ { title: 'Hello World',\n    date: '2012-08-09',\n    tags: [ 'hello world', 'misc' ] },\n  { title: 'The second article',\n    date: '2012-08-10',\n    tags: [ 'misc' ] } ]\n```\n\nfor the parsed string and the following for the _stringified_ array:\n\n``` javascript\n{\n  \"title\": \"Hello World\",\n  \"date\": \"2012-08-09\",\n  \"tags\": [\n    \"hello world\",\n    \"misc\"\n  ]\n}\n---\n{\n  \"title\": \"The second article\",\n  \"date\": \"2012-08-10\",\n  \"tags\": [\n    \"misc\"\n  ]\n}\n```\n\nBugs and Issues\n---------------\n\nIf you encounter any bugs or issues, feel free to\n[open an issue](https://github.com/pvorb/jsml/issues) at github.\n\nLicense\n-------\n\nCopyright © 2012 Paul Vorbach\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the “Software”), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","engines":{"node":">=0.4.0"},"licenses":[{"url":"http://vorb.de/license/mit.html","type":"MIT license"}],"repository":{"url":"git://github.com/pvorb/jsml.git","type":"git"},"description":"Appendable sequences of JSON documents","maintainers":[{"name":"pvorb","email":"paul@vorb.de"}],"dependencies":{},"devDependencies":{},"optionalDependencies":{},"_id":"jsml@0.1.0","version":"0.1.0"}