Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ulivz/gulp-replace
🍜 a Gulp file-replace and markdown-log-created task.
https://github.com/ulivz/gulp-replace
gulp nodejs
Last synced: 9 days ago
JSON representation
🍜 a Gulp file-replace and markdown-log-created task.
- Host: GitHub
- URL: https://github.com/ulivz/gulp-replace
- Owner: ulivz
- Created: 2016-12-30T15:35:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-30T16:20:22.000Z (over 5 years ago)
- Last Synced: 2025-01-20T17:50:02.040Z (21 days ago)
- Topics: gulp, nodejs
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# replace
a Gulp file-replace and markdown-log-created task.
## Quick Start
Backup your files, and create a copy of what you need to do, then config your path of files in the `replace.config/config.json`,
This is an example:
```
{
"path": [
{
"source": "replace.config/init/source/A.js",
"target_bak": "replace.config/init/bak/A.js",
"target": "src/A.js"
},
{
"source": "replace.config/init/source/B.js",
"target_bak": "replace.config/init/bak/B.js",
"target": "src/B.js"
}
]
}
```Next install the required dependencies for the project:
```
npm install --save-dev gulp run-sequence fs path del events
```Then you can replace the file with this instruction:
```
gulp replace
```and Use the following instructions to restore the file:
```
gulp resume
```You can also see the markdown file for the project execution process in:
```
replace.config/log/
```
A markdown file like this will give you a better understanding of the asynchronous execution of this project:---
**Create Time**: 12/31/2016, 1:00:51 AM
Type: replacestatus|description
---|---
start|getJSON
finish|getJSON
start|mapJSON
file[0]|**source**: replace.config/init/source/A.js
**target**: src/A.js
file[1]|**source**: replace.config/init/source/B.js
**target**: src/B.js
finish|mapJSON
delete|target files
start|replace
finish|replace [file1]
finish|replace [file0]
finish|replace
finish|ALL---
## Parameter Description:
parameters | note
---|---
source|path of the file to replace
target_bak|path of the target file backup
target|path of the target file## Declaration
We can not determine what name should be used, so All versions of the same file must use the same name