beginpm-template

0.0.5 • Public • Published

beginpm-template

Add templates to your module.

This is meant to be used with beginpm, but you can probably use it anywhere!

use

It's not very complicated:

const create = require('beginpm-template')
const cwd = '/path/to/module'
const options = {
	templates: [{
		from: '/absolute/path/to/input.txt',
		to: 'OUTPUT.txt'
	}]
}
create({ cwd }, options)
	.then(() => {
		// The file is written
		// /path/to/module/OUTPUT.txt
	})

options

templates (array)

A list of objects mapping a template file to a generated file. The required properties for each object are:

from (string)

This should be an absolute path to the template. A common pattern is:

{
	from: path.join(__dirname, 'template/my-template.txt')
}

to (string)

The output file, relative to the current working directory. If an intermediate folder is missing, it will be created.

license

This module beginpm-template, and all code and documentation, is published under the Very Open License

Readme

Keywords

Package Sidebar

Install

npm i beginpm-template

Weekly Downloads

0

Version

0.0.5

License

VOL

Last publish

Collaborators

  • saibotsivad