{"name":"endent","version":"1.0.2","description":"➡️ ES6 string tag that endows indentation from multi-line strings","main":"dist/index.js","files":["dist/index.js"],"scripts":{"build":"babel index.js --out-file dist/index.js","test":"jest"},"repository":{"type":"git","url":"git://github.com/ZhouHansen/endent.git"},"author":{"name":"zhouhancheng","email":"z308114274@gmail.com"},"keywords":["dedent","tag","multi-line string","es6"],"license":"ISC","devDependencies":{"babel-cli":"^6.22.2","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-es2015":"^6.22.0","babel-preset-es2016":"^6.22.0","babel-preset-es2017":"^6.22.0","flow-bin":"^0.38.0","jest":"^18.1.0"},"bugs":{"url":"https://github.com/ZhouHansen/endent/issues"},"homepage":"https://github.com/ZhouHansen/endent#readme","dependencies":{"dedent":"^0.7.0","objectorarray":"^1.0.2"},"gitHead":"475e3984bc86eaa013a23be1452ea4032bfaac99","_id":"endent@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"9.2.0","_npmUser":{"name":"zhouhancheng","email":"z308114274@gmail.com"},"dist":{"integrity":"sha512-nIT5ssIH02ZmkwXWFURFbsDcU9uFmnAkHqq26R123zRXImufJqJKYEb0digwJbJ+ySx0oLyEQDCmuJMLv8IPyQ==","shasum":"836b5c7740676d8a85f75016e90824fa846d95a7","tarball":"http://registry-npm.ywwl.com/endent/download/endent-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVGir2DT1PwxCH6nWqZiTjCMpsBNBUP++f733v/pk+mwIhAPP3hXDKB37SyP6+3GRJCl/uzodrTp1YyIz1VK+KTnKg"}],"size":2121,"noattachment":false,"key":"/endent/-/endent-1.0.2.tgz"},"maintainers":[{"name":"zhouhancheng","email":"z308114274@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/endent-1.0.2.tgz_1512737960549_0.23169045872054994"},"directories":{},"readme":"# Endent [![stability][stability-image]][stability-index]\n\n[![npm][npm-image]][npm-url]\n[![travis][travis-image]][travis-url]\n[![dm][dm-image]][npm-url]\n[![js-standard-style][code-style]][standard]\n\n[stability-image]: https://img.shields.io/badge/stability-stable-green.svg\n[stability-index]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[npm-image]: https://img.shields.io/npm/v/endent.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/endent\n[travis-image]: https://img.shields.io/travis/indentjs/endent.svg?style=flat-square\n[travis-url]: https://travis-ci.org/indentjs/endent\n[dm-image]: http://img.shields.io/npm/dm/endent.svg?style=flat-square\n[code-style]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard]: https://github.com/feross/standard\n\nAn ES6 string tag that makes indentation right, adds some key features to [dedent](https://github.com/dmnd/dedent).\n\n## Feature\n\n### Pretty object\n\n```ts\nimport dedent from \"dedent\";\nimport endent from \"endent\";\n\nvar someobj = {\n  contact: {\n    jack: 123456,\n    tom: 654321,\n  },\n  color: \"blue\",\n};\n\nvar somejson = '[\"bear\", \"fish\", \"dog\", \"cat\"]';\n\nvar awfulTmpl = dedent`\n  function store (state, emitter) {\n    state[\"someobj\"] = ${JSON.stringify(someobj, null, 2)}\n    state[\"somejson\"] = ${JSON.stringify(JSON.parse(somejson), null, 2)}\n  }\n`;\n// use endent.pretty(value) when value is object or array.\nvar prettyTmpl = endent`\n  function store (state, emitter) {\n    state[\"someobj\"] = ${endent.pretty(someobj)}\n    state[\"somejson\"] = ${somejson}\n  }\n`;\n\nconsole.log(awfulTmpl + \"\\n\\n\" + prettyTmpl);\n```\n\n```ts\n// awfulTmpl\nfunction store(state, emitter) {\n  state[\"someobj\"] = {\ncontact: {\n  jack: 123456,\n  tom: 654321,\n},\ncolor: \"blue\",\n}\n  state[\"somejson\"] = [\n\"bear\", \n\"fish\", \n\"dog\",\n\"cat\"\n]\n}\n\n// prettyTmpl\nfunction store(state, emitter) {\n  state[\"someobj\"] = {\n    contact: {\n      jack: 123456,\n      tom: 654321,\n    },\n    color: \"blue\",\n  }\n  state[\"somejson\"] = [\n    \"bear\", \n    \"fish\", \n    \"dog\", \n    \"cat\"\n  ]\n}\n```\n\n### Endows suitable indentation for multiline interpolation\n\n```ts\nvar dependencies = [\"jquery\", \"underscore\", \"bootstrap\"];\nvar dependencyTmpl = ``;\ndependencies.forEach((d, i) => {\n  dependencyTmpl += `var ${d} = require(\"${d}\")\\n`;\n});\n\nvar awfulTmpl = dedent`\n  ;(function () {\n    ${dependencyTmpl}\n  })()\n`;\n\nvar prettyTmpl = endent`\n  ;(function () {\n    ${dependencyTmpl}\n  })()\n`;\n\nconsole.log(awfulTmpl + \"\\n\\n\" + prettyTmpl);\n```\n\n```js\n// awfulTmpl\n(function () {\n  var jquery = require(\"jquery\");\nvar underscore = require(\"underscore\");\nvar bootstrap = require(\"bootstrap\");\n})();\n\n// prettyTmpl\n(function () {\n  var jquery = require(\"jquery\");\n  var underscore = require(\"underscore\");\n  var bootstrap = require(\"bootstrap\");\n})();\n```\n\n## License\n\nMIT\n","publish_time":1512737960617,"_cnpm_publish_time":1512737960617,"dist-tags":{"latest":"2.1.0"}}