grunt-string-to-js

0.0.3 • Public • Published

grunt-string-to-js

Build any text into JavaScript

```npm install grunt-string-to-js --save``

Grunt configuration

str2js: {
  NS: { 'test/build.js': ['test/html.html']}
}

Turns test/test.html

<div class="foo">
    <p class="bar">baz</p>
</div>

into test/build.js

var NS = NS || {};
NS["test/html.html"] = '<div class="foo">\n    <p class="bar">baz</p>\n</div>\n';

Credits

Credit for the regex goes to https://github.com/visionmedia/node-string-to-js

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-string-to-js

Weekly Downloads

46

Version

0.0.3

License

MIT

Last publish

Collaborators

  • zgohr