Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hrueger/redundancyjs

A cli tool to copy code files programatically.
https://github.com/hrueger/redundancyjs

Last synced: 13 days ago
JSON representation

A cli tool to copy code files programatically.

Awesome Lists containing this project

README

        

# RedundancyJS

[![npm](https://img.shields.io/npm/v/redundancyjs)](https://npmjs.com/package/redundancyjs)
[![License](https://img.shields.io/badge/License-MIT-blue)](./LICENSE.md)
[![GitHub last commit](https://img.shields.io/github/last-commit/hrueger/redundancyjs?color=brightgreen)](https://github.com/hrueger/redundancyjs/commits)
[![Maintenance](https://img.shields.io/maintenance/yes/2021)](https://github.com/hrueger/redundancyjs/commits)

This is a simple and easy to use CLI to copy code files programatically.

## Usage
Create a file called `redundancy.json` in the root fodler of your project. It has to look like this:
```json
{
"version": 1,
"files": [
{
"src": "AGtiv/src/app/data/ways.ts",
"dest": "api/src/data/"
}
]
}
```
Then, run `npx redundancyjs`.

You can watch for changes and automatically copy the files with `npx redundancyjs --watch` or `npx redundancyjs -w`.

You can also copy multiple files:
```json
{
"version": 1,
"files": [{
"src": "api/src/entity/*.ts",
"dest": "frontend/src/app/_models/"
}]
}
```

Remove TypeScript decorators:
```json
{
"version": 1,
"files": [{
"src": "api/src/entity/*.ts",
"dest": "frontend/src/app/_models/",
"removeDecorators": true
}]
}
```

Remove methods:
```json
{
"version": 1,
"files": [{
"src": "api/src/entity/*.ts",
"dest": "frontend/src/app/_models/",
"removeMethods": ["myMethodName", "anotherMethod", "doThis"]
}]
}
```

Remove imports:
```json
{
"version": 1,
"files": [{
"src": "api/src/entity/*.ts",
"dest": "frontend/src/app/_models/",
"removeImports": ["coolPackage", "lodash"]
}]
}
```

Change imported types from libraries to `any`:
```json
{
"version": 1,
"files": [{
"src": "api/src/entity/*.ts",
"dest": "frontend/src/app/_models/",
"changeInports": ["uncoolPackage"]
}]
}
```

## License
MIT