1.0.1 • Published 7 years ago

ivor-replace v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

ivor-replace

Transform text-files with custom values...

Introduction

A simple util due to help developers to transform files to create template files within custom values which is similar to wonderful yeoman :)

Supported develop environment with this better:

Getting Started

• npm install ivor-replace

• import transformer from 'ivor-replace'

• transformer(sourcePath, transArr, newName, newPath)

  • sourcePath

    	The Absolute path of your template files.
  • transArr

    	The Array to transfrom files within your custom values which is like this:
    
      [
      	{ 
    				key: 'a',
    				value: 'aaa'
    			},
    			{ 
    				key: 'b',
    				value: 'bbb'
    			},
    			{ 
    				key: 'c',
    				value: 'ccc'
    			}
    		]
  • newName

    	The name of the new files that you are gonna create.
  • newPath

    	The path of the new files that you are gonna create.

• Define values in template files

  • Define values in positions which should to replaced by '<##' and '##>' just like this:

    	import React, { Component } from 'react';<br>
    	<## a ##><br>
    	<## b ##><br>
    	const styles = StyleSheet.create(<## c ##>);
1.0.1

7 years ago

1.0.0

7 years ago