src2dist

0.2.1 • Public • Published

src2dist

NPM version Build Status Coverage Status NPM downloads Dependencies Status code style: prettier

Output the template source file to the destination by default variables

Feature

  • can be renamed
  • can be excluded

Install

npm i src2dist -D

Usage

import src2dist from 'src2dist'
// const src2dist = require("src2dist").default;
 
src2dist(
  sourcePath:String,
  distPath:String,
  variables?={}:Object,
  options?={}:Option
) => success:bool
 
interface Option {
  exclude?=defaultRenderExclude:Array[String|Regular]
  cover?=false:Boolean
}
 
const defaultRenderExclude = [
  '.*eot$',
  '.*svg$',
  '.*ttf$',
  '.*woff$',
  '.*jpe?g$',
  '.*png$',
  '.*gif$',
];
src2dist(
  `${__dirname}/source`,
  `${__dirname}/source-dist`,
  {
    name: 'n1',
  },
  {
    exclude: ['.*\.js'],
  }
);

Note

  • item of options.exclude is the relative path of the children file to sourcePath

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i src2dist

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

8.76 kB

Total Files

4

Last publish

Collaborators

  • bzone