layaair2-cmd
Version:
layaair version 2 toolkit
105 lines (104 loc) • 4.76 kB
JSON
{
"_args": [
[
{
"raw": "json-stable-stringify@~0.0.0",
"scope": null,
"escapedName": "json-stable-stringify",
"name": "json-stable-stringify",
"rawSpec": "~0.0.0",
"spec": ">=0.0.0 <0.1.0",
"type": "range"
},
"E:\\Mine\\Project\\git\\laya\\dawawa\\layaairdoc_cmd\\node_modules\\shasum"
]
],
"_from": "json-stable-stringify@>=0.0.0 <0.1.0",
"_id": "json-stable-stringify@0.0.1",
"_inCache": true,
"_location": "/json-stable-stringify",
"_npmUser": {
"name": "substack",
"email": "mail@substack.net"
},
"_npmVersion": "1.3.0",
"_phantomChildren": {},
"_requested": {
"raw": "json-stable-stringify@~0.0.0",
"scope": null,
"escapedName": "json-stable-stringify",
"name": "json-stable-stringify",
"rawSpec": "~0.0.0",
"spec": ">=0.0.0 <0.1.0",
"type": "range"
},
"_requiredBy": [
"/shasum"
],
"_resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz",
"_shasum": "611c23e814db375527df851193db59dd2af27f45",
"_shrinkwrap": null,
"_spec": "json-stable-stringify@~0.0.0",
"_where": "E:\\Mine\\Project\\git\\laya\\dawawa\\layaairdoc_cmd\\node_modules\\shasum",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"bugs": {
"url": "https://github.com/substack/json-stable-stringify/issues"
},
"dependencies": {
"jsonify": "~0.0.0"
},
"description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results",
"devDependencies": {
"tape": "~1.0.4"
},
"directories": {},
"dist": {
"shasum": "611c23e814db375527df851193db59dd2af27f45",
"tarball": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz"
},
"homepage": "https://github.com/substack/json-stable-stringify",
"keywords": [
"json",
"stringify",
"deterministic",
"hash",
"sort",
"stable"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "substack",
"email": "mail@substack.net"
}
],
"name": "json-stable-stringify",
"optionalDependencies": {},
"readme": "# json-stable-stringify\n\ndeterministic version of `JSON.stringify()` so you can get a consistent hash\nfrom stringified results\n\nYou can also pass in a custom comparison function.\n\n[](https://ci.testling.com/substack/json-stable-stringify)\n\n[](http://travis-ci.org/substack/json-stable-stringify)\n\n# example\n\n``` js\nvar stringify = require('json-stable-stringify');\nvar obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };\nconsole.log(stringify(obj));\n```\n\noutput:\n\n```\n{\"a\":3,\"b\":[{\"x\":4,\"y\":5,\"z\":6},7],\"c\":8}\n```\n\n# methods\n\n``` js\nvar stringify = require('json-stable-stringify')\n```\n\n## var str = stringify(obj, opts)\n\nReturn a deterministic stringified string `str` from the object `obj`.\n\nIf `opts` is given, you can supply an `opts.cmp` to have a custom comparison\nfunction for object keys. Your function `opts.cmp` is called with these\nparameters:\n\n``` js\nopts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue })\n```\n\nFor example, to sort on the object key names in reverse order you could write:\n\n``` js\nvar stringify = require('json-stable-stringify');\n\nvar obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };\nvar s = stringify(obj, function (a, b) {\n return a.key < b.key ? 1 : -1;\n});\nconsole.log(s);\n```\n\nwhich results in the output string:\n\n```\n{\"c\":8,\"b\":[{\"z\":6,\"y\":5,\"x\":4},7],\"a\":3}\n```\n\nOr if you wanted to sort on the object values in reverse order, you could write:\n\n```\nvar stringify = require('json-stable-stringify');\n\nvar obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };\nvar s = stringify(obj, function (a, b) {\n return a.value < b.value ? 1 : -1;\n});\nconsole.log(s);\n```\n\nwhich outputs:\n\n```\n{\"d\":6,\"c\":5,\"b\":[{\"z\":3,\"y\":2,\"x\":1},9],\"a\":10}\n```\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install json-stable-stringify\n```\n\n# license\n\nMIT\n",
"readmeFilename": "readme.markdown",
"repository": {
"type": "git",
"url": "git://github.com/substack/json-stable-stringify.git"
},
"scripts": {
"test": "tape test/*.js"
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/8..latest",
"ff/5",
"ff/latest",
"chrome/15",
"chrome/latest",
"safari/latest",
"opera/latest"
]
},
"version": "0.0.1"
}