Pull in source files, inlining them where indicated by comment meta-tags.
npm install meta-inline
|8||downloads in the last week|
|8||downloads in the last month|
|Version||0.0.8 last updated 5 months ago|
|Keywords||compile, build, inline|
Replace comment meta-data tags with source from the referenced file.
npm install -g meta-inline
meta-inline source.js > output.js
The source file with all inline tags replaced, is output to STDOUT.
Tags are always block comments and always start with the word "inline" followed by a file name. Relative file names are relative to the file that contains the tag.
/* inline foo.js */
Multiple file names can be comma separated...
/* inline foo.js, bar.js */
... or newline separated.
/* inline foo.js bar.js */
The entire tag will be replaced by the source of the files referenced by the tag. If the inlined source also contains tags, those tags will be processed recursively.
Quoted Block Text
You can also inline a block of text by preceding the tag with a pair of double
"" or single
var str = ""/* inline foo.js */;
Given a file foo.js which contains the following...
"Hello" World! \
... then the tag (including the preceding quote pair) will become the following.
var str = "\"Hello\"\nWorld!\n\\";
Notice that appropriate quotes, newline characters, and backslashes have been escaped. if you were to
console.log(str), then text identical to what's in foo.js would be output to the console.