# @codemod/core

> Runs babel plugins for codemods, i.e. by preserving formatting using Recast.

Latest version **2.2.0** (published 2023-02-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @codemod/core
pnpm add @codemod/core
yarn add @codemod/core
bun add @codemod/core
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2023-02-18 |
| First published | 2019-08-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 435 |
| Author | Brian Donovan |
| Maintainers | eventualbuddha, codemod-bot |

## Links

- npm: https://www.npmjs.com/package/@codemod/core
- Repository: https://github.com/codemod-js/codemod
- Homepage: https://github.com/codemod-js/codemod#readme
- Issues: https://github.com/codemod-js/codemod/issues
- npm.io page: https://npm.io/package/@codemod/core

## Dependencies (6)

- [recast](https://npm.io/package/recast.md) ^0.19.0
- [resolve](https://npm.io/package/resolve.md) ^1.12.0
- [is-ci-cli](https://npm.io/package/is-ci-cli.md) ^2.2.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.20.12
- [@codemod/parser](https://npm.io/package/@codemod/parser.md) ^1.4.0
- [@babel/generator](https://npm.io/package/@babel/generator.md) ^7.20.14

## Recent versions

- 2.2.0 (latest) — 2023-02-18
- 2.1.0 — 2023-02-17
- 2.0.1 — 2021-11-14
- 2.0.0 — 2021-11-12
- 1.1.1 — 2021-08-19
- 1.1.0 — 2020-11-10
- 1.0.7 — 2020-04-05
- 1.0.6 — 2020-03-25
- 1.0.5 — 2020-01-13
- 1.0.4 — 2019-12-16
- 1.0.3 — 2019-10-23
- 1.0.2 — 2019-08-09
- 1.0.1 — 2019-08-09
- 1.0.0 — 2019-08-03

## README

# @codemod/core

Runs babel plugins for codemods, i.e. by preserving formatting using [Recast](https://github.com/benjamn/recast).

## Install

Install from [npm](https://npmjs.com/):

```sh
$ npm install @codemod/core
```

## Usage

```ts
import { transform } from '@codemod/core'

const result = transform('a ?? b', {
  plugins: ['@babel/plugin-proposal-nullish-coalescing-operator'],
})

console.log(result.code)
/*
var _a;
(_a = a) !== null && _a !== void 0 ? _a : b
*/
```

## Contributing

See [CONTRIBUTING.md](../../CONTRIBUTING.md) for information on setting up the project for development and on contributing to the project.

## License

Copyright 2019 Brian Donovan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

---
_Source: https://npm.io/package/@codemod/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
