es-string

1.0.2 • Public • Published

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 <style> 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>

Readme

Keywords

none

Package Sidebar

Install

npm i es-string

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

3.56 kB

Total Files

4

Last publish

Collaborators

  • jessereitz