0.2.1 • Published 6 years ago

src2dist v0.2.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

1.0.0

6 years ago