string-puzzler

0.4.12 • Public • Published

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 ;
 
}`

Package Sidebar

Install

npm i string-puzzler

Weekly Downloads

2

Version

0.4.12

License

SEE README.md

Unpacked Size

11.5 kB

Total Files

11

Last publish

Collaborators

  • orivoir21