Skip to content

A super simple module for including files in other files.

License

Notifications You must be signed in to change notification settings

revdavethompson/includerJS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IncluderJS

A bare bones module for including files in other files.

Use

@include "file"

About

IncluderJS's entry is a single file, srcDoc. All includes are processed from the beginning to the end of the document. Contents from each included file are spliced into the source document. All includes must be in the the srceDir.

  • IncluderJS is built using ES Modules

your-library.js

import includerJS from 'includerJS'

const srcDir = "path/to/files/"
const srcDoc = "initialFile"

const processedDoc = includerJS(srcDoc, { basePath: srcDir });

initial-file.md (using markdown as the example, but you can use anything)

This is some text content in your srcDoc.

@include "another-file.md"

another-file.md

This is some other content that will be spliced in and replace the include statement

'resulting-file.md'

This is some text content in your srcDoc.

This is some other content that will be spliced in and replace the include statement

About

A super simple module for including files in other files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%