/ivor-replace

Transform text-files with custom values...

Primary LanguageJavaScript

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';
    <## a ##>
    <## b ##>
    const styles = StyleSheet.create(<## c ##>);