
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
fragment-include
Advanced tools
.("""") (j)
(_(_ __(_ ) (n o d e)
_ / / / (n) (s)
)) ) ) ___ )_ __ __ / / / n \|/ \|/
((,(,' (_(| (_ (('(| n \|/ | |
Part of the Node Water collection.
It's a command line tool call called fipp (the fragment include pre-processor), which helps you include fragments from some files in others, so you Dont Repeat Yourself.
Great for including examples from your code in your documentation.
Fipp instructions are embedded in your files using comments. This means they won't effect the normal use of your files, but fipp parse for and use them.
There are two kinds of files fipp works with, source and target. The most basic use of fipp is:
$ fipp <target>
Fipp will parse the target file looking for **fragment-include* ** instuctions which it will replace with fragments from source files. Fragments in the source files are denfined using **fragment-define* ** instuctions. There are five instuctions in total.
Fipp uses the following logic.
file1.md
#Here is an example
<!--- fragment-include file2.js#example1 --->
file2.js
var a = 1;
/*** fragment-define-start example1 ***/
var b = 2;
/*** fragment-define-end ***/
var c = 3;
fipp file1.md will updated file1.md to be:
file1.md
#Here is an example
<!--- fragment-include-start file2.js#example1 --->
\`\`\`js
var b = 2;
\`\`\`
<!--- fragment-include-end --->
Fipp looks for comments in a file based on it's extension. The comments must be exactly as follows:
<!--- and end with --->./*** and end with ***/.Official releases can be obtained from:
npm install -g fragment-includeThe lastest developed code may node have not have been released, but can always be found from:
See the output of fipp --help
FAQs
Wash your files with this preprocessor and DRY
We found that fragment-include demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.