string-puzzler
v0.4.12
Published
> implement one method **puzzler** inside `String.prototype`
Downloads
5
Maintainers
Readme
string-puzzler
implement one method puzzler inside
String.prototype
easier build string elements with auto persist indent
Instalation
npm i string-puzzler --save-dev
yarn add string-puzzler
usage:
require('string-puzzler') ; // import method "String.prototype.puzzler"
const outline = `
constructor( app ) {
__BUILD_HERE__
}
` ;
const core = `
this.a = 2 ;
this.b = 3 ;
this.c = 4 ;
` ;
const marker = '__BUILD_HERE__' ;
const build = outline.puzzler( core , marker ) ;
build log:
`constructor( app ) {
this.a = 2 ;
this.b = 3 ;
this.c = 4 ;
# eg: new Account( app ) ;
}`
with only : outline.replace( marker , core ) ;
build log:
`constructor( app ) {
this.a = 2 ;
this.b = 3 ;
this.c = 4 ;
}`