Dynamic-api
An API to import fragmented files within other.
Current version: 1.0.0
Node support: 0.10.x, 0.11.x
var dynamic = require('dynamic-api');
var contentCompiled = dynamic(fileStream, opt);
Install
Install dynamic-api with npm:
$ npm install dynamic-api
Usage
You can require the module:
var dynamic = require('dynamic-api');
Return a string of file compiled:
dynamic( path, content [, opt] )
Options
paths = array de path relative
ignoreRepeated = boolean for ignore file repeated or not, default true
Example:
dynamic( path, content, {
paths: [__dirname + '/directory'],
ignoreRepeated: false
});
Usage import on files
Import file on .js:
//import("path/file.js");
//import("file2.js");
Import file on .html:
<!--import("path/file.html")-->
<!--import("file2.html")-->
Import file on .css:
/*import("path/file.css")*/
/*import("file2.css")*/
Import file on a file any file:
!import("path/file.txt")
!import("file2.txt")
Contributing
To contribute to dynamic-api, clone this repo locally and commit your code.
Please check that everything works before opening a pull-request.
License
Dynamic-api is licensed under the MIT License