Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/r17x/jasat

Codemod for JavaScript Stuff (Jasat is shortname)
https://github.com/r17x/jasat

ast codemod javascript transform typescript

Last synced: about 2 months ago
JSON representation

Codemod for JavaScript Stuff (Jasat is shortname)

Awesome Lists containing this project

README

        


jasat overview
Tools for code moderation, transformation, or use for maintain JavaScript stuff related.



CI Release status


NPM jasat version


Use case
Usage
Special Thanks
Alternative
Contribution
License

## Use case

- find and replace some code.
- remove some code (like `console.log`).

## Usage

### Using with `npx`

```console

npx jasat [OPTIONS]

```

### Using as development dependencies

#### add in `devDependencies`

```console

yarn add -D jasat

```

#### run

```console

yarn jasat [OPTIONS]

```

### Transforms

| Name | OPTIONS |
| ----------------------- | ----------- |
| `import-source-replace` | "FROM" "TO" |
| `remove-console` | - |

### Command OPTIONS

```console

Tools for code moderation, transformation, or use for maintain JavaScript stuff related.

USAGE
npx jasat <...OPTIONS>

OPTIONS
--write, -w Allow to modified target file.
--cwd, -C Set current working directory (default: `process.cwd()`).
--help, -h Print help.
--list, -l Print list of TRANSFORM.
--version, -v Print version.

```

### Example

```console

npx jasat import-source-replace "react" "preact" // dry-run
npx jasat import-source-replace "react" "preact" --write // write to system or target files

```

## Special Thanks

- [**equivalent-exchange**](https://github.com/suchipi/equivalent-exchange) - Transmute one JavaScript string into another by way of mutating its AST. Powered by babel and recast.

## Alternative

- [**jscodeshift**](https://github.com/facebook/jscodeshift) - A JavaScript codemod toolkit.
- [**comby**](https://github.com/comby-tools/comby) - A tool for structural code search and replace that supports ~every language.

## Contribution

### Making pull requests

- Use [**conventional-commits**](https://www.conventionalcommits.org/en/v1.0.0/) before make a pull request.

## License

**MIT**