Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

dopl

0.2.0 • Public • Published

dopl

Use dopl to make a new directory based on a template directory. Processes each file through mustache and provides filename template strings.

Example

const dopl = require('dopl');
 
dopl({
  name: 'heading',
  src: 'templates/simple-component',
  output: 'source', 
  data: {
    timestamp: +new Date()
  }
})
.then(() => {
  console.log(`${name} created!`);
});

Options

name –– name of new directory

src –– directory to use as a template

output –– directory to output copy

data –– data to pass into mustache

render –– function with the form fn(file, data) for rendering files, if you'd like to replace mustache with another templating engine.

Filename Interpolation

Filenames with [name] included will be replaced with name option.

// config
dopl({
    name: 'mega',
    output: 'dist'
})

// input file
[name].html
assets/[name].css

// output file
dist/mega.html
dist/assets/mega.css

Install

npm install dopl

CLI

npm install dopl -g
dopl --src templates/original --output source/directory new-copy

License

MIT 2016 Evan Krambuhl

Keywords

none

install

npm i dopl

Downloadsweekly downloads

20

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability