1.1.10 • Published 6 years ago

replace-holder v1.1.10

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

install

npm install --save replace-holder

test

npm run test

usage

${{replace-holder}}

string

import placeholder from 'replace-holder';
const result = placeholder.string('i am ${{name}}', {
  name: 'replace-holder',
});

file async

import placeholder from 'replace-holder';
placeholder.file(path.join(__dirname, 'fixtures/a.txt'), {
  name: 'replace-holder',
}, __dirname, function (err) {
  if (err) console.log(err);
  const contents = fs.readFileSync(path.join(__dirname, 'a.txt'), { encoding: 'utf8' });
});

file sync

import placeholder from 'replace-holder';
placeholder.fileSync(path.join(__dirname, 'fixtures/a.txt'), {
  name: 'replace-holder',
}, __dirname);
const contents = fs.readFileSync(path.join(__dirname, 'a.txt'), { encoding: 'utf8' });

dir sync

import placeholder from 'replace-holder';
const source = path.join(__dirname, 'fixtures/demo/**');
const dest = path.join(__dirname, 'target');
placeholder.fileSync(source, {
    projName: 'legoProj',
  }, dest, { ignoreBase: ['png'] });

dir async

import placeholder from 'replace-holder';
const source = path.join(__dirname, 'fixtures/demo/**');
const dest = path.join(__dirname, 'target');
placeholder.file(source, {
    projName: 'legoProj',
  }, dest, { ignoreBase: ['png'] }, function (err) {
    if (err) console.log(err);
  });
1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago