{"_id":"strands","_rev":"13-1553691a5e5ef02278792f4983e84dab","name":"strands","description":"Simple, light-weight string building for JavaScript","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.0":{"name":"strands","version":"0.0.0","description":"Simple, light-weight string building for JavaScript","main":"dist/index.js","typings":"dist/index.d.ts","files":["dist/"],"scripts":{"lint":"tslint \"src/**/*.ts\"","build":"rm -rf dist/ && tsc","test-spec":"blue-tape -- \"dist/**/*.spec.js\" | tap-spec","test-cov":"istanbul cover --print none -x \"*.spec.js\" blue-tape \"dist/**/*.spec.js\" | tap-spec","test":"npm run lint && npm run build && npm run test-cov","prepublish":"typings install && npm run build"},"repository":{"type":"git","url":"git://github.com/mulesoft-labs/node-strands.git"},"keywords":["template","string","builder","concat","strings"],"author":{"name":"MuleSoft, Inc."},"license":"Apache-2.0","bugs":{"url":"https://github.com/mulesoft-labs/node-strands/issues"},"homepage":"https://github.com/mulesoft-labs/node-strands","devDependencies":{"blue-tape":"^0.2.0","istanbul":"^0.4.2","pre-commit":"^1.0.6","tap-spec":"^4.1.1","tslint":"^3.2.0","typescript":"^1.7.5","typings":"^0.6.1"},"gitHead":"3a2e116ed7c480c7b9b120378d5c13ec3028e4f0","_id":"strands@0.0.0","_shasum":"10cfa02c631cfea31ea466ff6a1754af2831e3ec","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"shasum":"10cfa02c631cfea31ea466ff6a1754af2831e3ec","tarball":"https://registry.npmjs.org/strands/-/strands-0.0.0.tgz","integrity":"sha512-adLoT5JVlF80Gc+ptKZBB8HfUu/+tVi0Uzi87ysf2Kqsf5jq1l2N+SKpR0tjoMefI9Z+10AMZNKbdWMnc2j9Jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD81iNfggE8oMKHi9/u4cLScmAwjWECrxkcqn42COyugQIgRL++Og7/LUjqIC9K8DscooKkoujLZywmqRr6TXPkm88="}]},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/strands-0.0.0.tgz_1455754011496_0.7645746890921146"}},"1.0.0":{"name":"strands","version":"1.0.0","description":"Simple, light-weight string building for JavaScript","main":"dist/index.js","typings":"dist/index.d.ts","files":["dist/"],"scripts":{"lint":"tslint \"src/**/*.ts\"","build":"rm -rf dist/ && tsc","test-spec":"blue-tape -- \"dist/**/*.spec.js\" | tap-spec","test-cov":"istanbul cover --print none -x \"*.spec.js\" blue-tape \"dist/**/*.spec.js\" | tap-spec","test":"npm run lint && npm run build && npm run test-cov","prepublish":"typings install && npm run build"},"repository":{"type":"git","url":"git://github.com/mulesoft-labs/node-strands.git"},"keywords":["template","string","builder","concat","strings"],"author":{"name":"MuleSoft, Inc."},"license":"Apache-2.0","bugs":{"url":"https://github.com/mulesoft-labs/node-strands/issues"},"homepage":"https://github.com/mulesoft-labs/node-strands","devDependencies":{"blue-tape":"^0.2.0","istanbul":"^0.4.2","pre-commit":"^1.0.6","tap-spec":"^4.1.1","tslint":"^3.2.0","typescript":"^1.7.5","typings":"^0.6.1"},"gitHead":"fe301dc003e1a10452ea40df632a0625b1dc52b8","_id":"strands@1.0.0","_shasum":"bfcf25d6b632dd484127b6b0cbd070e66d6f5f58","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"shasum":"bfcf25d6b632dd484127b6b0cbd070e66d6f5f58","tarball":"https://registry.npmjs.org/strands/-/strands-1.0.0.tgz","integrity":"sha512-HLsyvh/LCVX6pecmmXmiSzUKsZT+c7DlG2bv40TtrhuvjqsRXqZn2iDQHM0KsWKnOtWfJFWhTSTtj3nDOJPwRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9b6ClR/owAxoOeEqW9z+lFyDILeZu1SK8jaLvtlBY+wIhAPSaXWwvM1OV8BllsjmYCb1XkvsYonZhh1PwKWB9nI7/"}]},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/strands-1.0.0.tgz_1455754141785_0.4226450794376433"}},"1.0.1":{"name":"strands","version":"1.0.1","description":"Simple, light-weight string building for JavaScript","main":"dist/index.js","typings":"dist/index.d.ts","files":["dist/"],"scripts":{"lint":"tslint \"src/**/*.ts\"","build":"rm -rf dist/ && tsc","test-spec":"blue-tape -- \"dist/**/*.spec.js\" | tap-spec","test-cov":"istanbul cover --print none -x \"*.spec.js\" blue-tape \"dist/**/*.spec.js\" | tap-spec","test":"npm run lint && npm run build && npm run test-cov","prepublish":"typings install && npm run build"},"repository":{"type":"git","url":"git://github.com/mulesoft-labs/node-strands.git"},"keywords":["template","string","builder","concat","strings"],"author":{"name":"MuleSoft, Inc."},"license":"Apache-2.0","bugs":{"url":"https://github.com/mulesoft-labs/node-strands/issues"},"homepage":"https://github.com/mulesoft-labs/node-strands","devDependencies":{"blue-tape":"^0.2.0","istanbul":"^0.4.2","pre-commit":"^1.0.6","tap-spec":"^4.1.1","tslint":"^3.2.0","typescript":"^1.7.5","typings":"^0.6.1"},"gitHead":"349c1704778330d4f695f1a5966af7ea70379c2b","_id":"strands@1.0.1","_shasum":"aee20bcbc9df8615780c19ffed0d785efc7a4d33","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"shasum":"aee20bcbc9df8615780c19ffed0d785efc7a4d33","tarball":"https://registry.npmjs.org/strands/-/strands-1.0.1.tgz","integrity":"sha512-y3SwBPdw6hDMCDoZhxG6o2FgjWMiUbLyRdNcSmzmQThU2gG4T9pM/YKWbCVrubW+i7xCvFBJ4Ck8LHdRwT44qA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9Rjdr6v6HNpH8k9W5HKwpiM+o3Hg9FLjc7vUEtCXmuAIhAIQJFyo+w6djJIOCghaTFd914ClxiCfcQ43IDve3cI7s"}]},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/strands-1.0.1.tgz_1455754397732_0.902296076528728"}}},"readme":"# Strands\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n\n> Simple, light-weight string building for JavaScript.\n\n## Installation\n\n```\nnpm install strands --save\n```\n\n## Usage\n\n### String Building\n\nFor simple string building.\n\n**strand (separator = '', prefix = '', suffix = '')**\n\n```js\nimport { strand } from 'strands'\n\nconst query = strand(' ', '', ';')\n\nquery('SELECT *')\nquery('FROM', tableName)\nquery('WHERE count > 10')\n\nconsole.log(query) //=> \"SELECT * FROM test WHERE count > 10;\"\n```\n\n### Template Building\n\nThe template class built on top of a `strand`.\n\n**new Strands ({ indent = '', eol = '\\n' })**\n\n```js\nimport { Strands } from 'strands'\n\nconst html = new Strands()\nconst head = new Strands({ indent: '  ' })\nconst body = new Strands({ indent: '  ' })\n\nhead.line('<meta charset=\"utf8\">')\n\nbody.line('<h1></h1>')\nbody.return()\nbody.line('<div></div>')\n\nhtml.line('<!doctype html>')\nhtml.line('<html>')\nhtml.line('<head>')\nhtml.append(head)\nhtml.line('</head>')\nhtml.line('<body>')\nhtml.append(body)\nhtml.line('</body>')\nhtml.line('</html>')\n\nconsole.log(html.toString())\n//=> \"<!doctype html>\\n<html>\\n<head>\\n  <meta charset=\"utf8\">\\n</head>\\n<body>\\n  <h1></h1>\\n\\n  <div></div>\\n</body>\\n</html>\\n\"\n```\n\n### Template Wrapper\n\nSimple wrapper function for creating a \"template-like function\".\n\n**wrap <T> (fn: (t: Strands, data: T) => any, options?: Options): (data: T) => string**\n\n```js\nimport { wrap } from 'strands'\n\nconst doc = wrap(function (t, data) {\n  t.line('### Authors')\n  t.line()\n\n  data.authors.forEach(function (author) {\n    t.line('* ', author.name)\n  })\n})\n\nconsole.log(doc({ authors: [{ name: 'Blake' }, { name: 'John' }] }))\n//=> \"### Authors\\n\\n* Blake\\n* John\\n\"\n```\n\n## Useful Libraries\n\n* [string-template](https://www.npmjs.com/package/string-template) - For simple placeholder replacement\n* [moment](https://www.npmjs.com/package/moment) - For date formatting\n* [chalk](https://www.npmjs.com/package/chalk) - For terminal color\n\n## License\n\nApache License 2.0\n\n[npm-image]: https://img.shields.io/npm/v/strands.svg?style=flat\n[npm-url]: https://npmjs.org/package/strands\n[downloads-image]: https://img.shields.io/npm/dm/strands.svg?style=flat\n[downloads-url]: https://npmjs.org/package/strands\n[travis-image]: https://img.shields.io/travis/mulesoft-labs/node-strands.svg?style=flat\n[travis-url]: https://travis-ci.org/mulesoft-labs/node-strands\n[coveralls-image]: https://img.shields.io/coveralls/mulesoft-labs/node-strands.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/mulesoft-labs/node-strands?branch=master\n","maintainers":[{"email":"mulesoft-npm@mulesoft.com","name":"mulesoft-npm"},{"email":"juan.coen@mulesoft.com","name":"juan.coen"},{"email":"christianvogel84@gmail.com","name":"christianvogel"},{"email":"cesaraugusto86@hotmail.com","name":"cesaraugustogarcia"}],"time":{"modified":"2022-06-27T00:40:38.885Z","created":"2016-02-18T00:06:53.845Z","0.0.0":"2016-02-18T00:06:53.845Z","1.0.0":"2016-02-18T00:09:04.234Z","1.0.1":"2016-02-18T00:13:19.978Z"},"homepage":"https://github.com/mulesoft-labs/node-strands","keywords":["template","string","builder","concat","strings"],"repository":{"type":"git","url":"git://github.com/mulesoft-labs/node-strands.git"},"author":{"name":"MuleSoft, Inc."},"bugs":{"url":"https://github.com/mulesoft-labs/node-strands/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}