cp-as-template
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "cp-as-template", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Copy code file as a template.", | ||
@@ -5,0 +5,0 @@ "main": "bin/index.js", |
@@ -5,3 +5,3 @@ [![Build Status](https://travis-ci.org/wmzy/cp-as-template.svg?branch=master)](https://travis-ci.org/wmzy/cp-as-template) | ||
> Copy code file as a template. | ||
> Copy source code file as a template. If you often new file by copy & search & replace,try it. | ||
@@ -15,5 +15,45 @@ ## Install | ||
```bash | ||
npx cp-as-template | ||
npx cp-as-template --help | ||
``` | ||
## Usage | ||
```js | ||
// user.js | ||
class User{} | ||
function createUser() { | ||
const user = new User(); | ||
return user; | ||
} | ||
``` | ||
```bash | ||
$ cp-as-template user.js post.js | ||
$ cat post.js | ||
``` | ||
```js | ||
// user.js | ||
class Post{} | ||
function createPost() { | ||
const post = new Post(); | ||
return post; | ||
} | ||
``` | ||
### More | ||
```bash | ||
$ cp-as-template --help | ||
Usage: cp-as-template [options] <source> <dest> | ||
Options: | ||
-V, --version output the version number | ||
-v, --verbose explain what is being done | ||
-h, --help output usage information | ||
``` |
8084
58