https://github.com/fantasyui-com/distr
Smartly change src path to dist path, for use in small build systems. [Library, Algorithm, Standard Library]
https://github.com/fantasyui-com/distr
Last synced: 21 days ago
JSON representation
Smartly change src path to dist path, for use in small build systems. [Library, Algorithm, Standard Library]
- Host: GitHub
- URL: https://github.com/fantasyui-com/distr
- Owner: fantasyui-com
- License: gpl-3.0
- Created: 2018-06-11T12:16:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-19T18:16:12.000Z (over 4 years ago)
- Last Synced: 2025-11-24T03:07:55.092Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# distr
Smartly change src path to dist path, for use in small build systems.
## Installation
```Bash
$ npm i distr;
```
## Configuration
```JavaScript
{
source: 'src', // directory fragment to target can be RegExp: /src|source/
destination: 'dist', // new name to use
limit:1 // number of replacements to make
}
```
## Example
```JavaScript
const distr = require('distr');
distr('./src/www/index.html');
//-> ./dist/www/index.html
distr('./sources/widgets/upload-component/src/index.js', {source:/sources|src/, limit:2});
//-> ./dist/widgets/upload-component/dist/index.js
```