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.
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.
npm install --save-dev es-string
node_modules/.bin/es-string <source file> <destination file>