fs-template

1.0.1 • Public • Published

fs-template

copy a template directory with variables injected

implemented using pull streams for every async operation, so is very fast and usess minimal memory. 🏇

npm install --save fs-template

usage

template = require('fs-template')

template(options, (err) => {})

options is an object of the following:

  • source: required source directory path
  • target: required target directory path
  • vars: object of variables to inject into templates (default: {})
  • cwd: current working directory to resolve relative file paths (default: process.cwd())
  • open: string to denote opening of variable injection (default: "{{")
  • close: string to denote closing of variable injection (default: "}}")
  • parallel: how many async operations to run in parallel (default: 10)

callback is called when operation is done, either complete or has errored.

license

The Apache License

Copyright © 2017 Michael Williams

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependents (1)

Package Sidebar

Install

npm i fs-template

Weekly Downloads

1

Version

1.0.1

License

Apache-2.0

Last publish

Collaborators

  • ahdinosaur