1.0.2 • Published 6 years ago

es-string v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

es-string

Place the contents of any text file in an es6 module.

es-string allows you to easily access and manipulate the contents of any text file by placing them in an es6 module, exported as a string. From here, you can import the string in any other module and manipulate it as you wish.

Why?

Originally, es-string was devised as a way to dynamically insert the contents of a CSS file into any arbitrary HTML document. For instance, if you are writing a browser tool you would like to publish as an npm package but would still like to write your styles as Sass, Less, or plain CSS es-string makes it easy. Simply make es-string a part of your build process, placing the contents of your CSS file in a JavaScript module and dynamically adding them to a tag on page load. This way, you don't have to deal with packaging in CSS files or messy inline styles in JavaScript. Plus, you still have access to the pre-/post- processors you love.

How?

npm install --save-dev es-string
node_modules/.bin/es-string <source file> <destination file>
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago