X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Ftsml%2FREADME.md;fp=node_modules%2Ftsml%2FREADME.md;h=c68287fcc37175b4b6fbb68277c4f215b4845de9;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/tsml/README.md b/node_modules/tsml/README.md new file mode 100644 index 000000000..c68287fcc --- /dev/null +++ b/node_modules/tsml/README.md @@ -0,0 +1,36 @@ +# tsml + +**ES6 template string tag for multi-line cleaning - squash multi-line strings into a single line** + +Use template strings to split up complex string creation over multiple lines and have the newlines and newline white-space prefixes cleaned for you. + +`tsml` is primarily for code readability. Split up template strings over newlines, indent or add additional blank lines to space things out. + +## Example + +From [changelog-maker](https://github.com/rvagg/changelog-maker): + +```js +const tsml = require('tsml') + +function toStringSimple (data) { + return tsml` + + * [${data.sha.substr(0, 10)}] - + ${data.semver.length ? '(' + data.semver.join(', ').toUpperCase() + ') ' : ''} + ${data.revert ? 'Revert "' : ''} + ${data.group ? data.group + ': ' : ''} + ${data.summary} + ${data.revert ? '"' : ''} + ${data.author ? '(' + data.author + ') ' : ''} + ${data.pr} + + ` +} + +// -> * [7e88a9322c] - src: make accessors immune to context confusion (Ben Noordhuis) #1238 +``` + +## License + +**tsml** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. \ No newline at end of file