Code Monkey home page Code Monkey logo

copy-as's Introduction

cpas

Use your code as a template

GitHub issues GitHub stars NPM

Intro

If you've created your perfect component structure and you want it to be your template for the rest the cpas is for you. Copies files and directory structure making replacements in file and directory names and in content.

Replacement is case preserving. It tries to preserve existing casing including UPPER and lower cased strings and also PascalCase, camelCase, snake_case and kebab-case

Usage

Install globally

npm install -g @wooboo/cpas

Run - full usage

cpas ./components/my-component ./components --replace "my component/perfect button" --ignore lib --ignore bin --ignore *.log

or in your dev dependencies

npm install @wooboo/cpas --save-dev

setup npm script

"scripts": {
  "gen:component": "cpas ./components/my-component --replace 'my component' --ignore lib --ignore bin --ignore *.log",
}
npm run gen:component

Ignoring

Create .cpasignore file in your root directory with common files to ignore while processing.

CLI reference

$ cpas [source] [destination] <options>

  [source], -s, --source             source file or directory to copy
  [destination], -d, --destination   destination directory to copy
  -r, --replace                      replace pattern (multiple)
                                     <from>/<to> - replaces 'from' to 'to'
                                     <from> - asks for 'to'
                                     if ommited asks for replacement pattern
  -i, --ignore                       file and directory ignores (multiple)

copy-as's People

Watchers

Piotr Zabowka avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.