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

npm-template-sync

7.2.10 • Public • Published

npm Greenkeeper semantic-release styled with prettier Build Status codecov.io Coverage Status Known Vulnerabilities GitHub Issues Stories in Ready Dependency Status devDependency Status docs XO code style downloads Commitizen friendly

npm-template-sync

Keep npm package in sync with its template

npm-template-sync --template aTemplateGithubUser/aRepo myGithubUser/myRepo

define (initial) properties to be used in the template

npm-template-sync --define "description=a very new fantastic module" -t myUser/myTemplate myUser/newModule

merges contents from template repo into destination repo handling some special cases for:

  • Licenses - rewriting license years
  • line set files like .npmignore and .gitignore - by merging both sets together
  • package.json - merge devDependencies, engines and scripts
  • rollup.conf.js - copy / rewrite

generated pull request

Some templates

API

Table of Contents

Context

Parameters

  • provider RepositoryProvider
  • options Object

Properties

  • provider RepositoryProvider
  • options Object
    • options.templateBranchName string

PreparedContext

context prepared to execute one package

Parameters

Properties

usedDevModules

all used dev modules

Returns Set<string>

execute

Returns Promise<PullRequest>

File

Mergable File

Parameters

  • path string location in the repository
  • options Object mergin options (optional, default {})

Properties

properties

Deliver some key properties

Parameters

  • branch Branch

Returns Object

merge

Parameters

  • context PreparedContect

Returns Object merged content

templateOptions

find merger options in the template section of a package.json

Parameters

Returns Object

diffVersion

Parameters

Readme

Extends File

injects badges into REAMDE.md

sortedKeys

order in which json keys are written

Package

Extends File

Merger for package.json

properties

Deliver some key properties

Parameters

  • branch Branch

Returns Object

defaultMerge

Parameters

  • destination
  • target
  • template
  • dp
  • name
  • messages

normalizePackage

bring package into nomalized (sorted) form

Parameters

Returns Object normalized source

MergeAndRemoveLineSet

Extends MergeLineSet

MergeLineSet

Extends File

File where every line is a key

defaultIgnoreSet

entries to be skipped from result

Returns Set<string>

NpmIgnore

Extends MergeAndRemoveLineSet

defaultIgnoreSet

entries to be skipped from result

Returns Set<string>

ReplaceIfEmpty

Extends File

Overwrites none existing file from template

Replace

Extends File

Replace file from template (always)

install

With npm do:

npm install -g npm-template-sync
 
# npm-template-sync --help 

license

BSD-2-Clause

Keywords

install

npm i npm-template-sync

Downloadsweekly downloads

760

version

7.2.10

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar