Skip to content

Commit

Permalink
Merge pull request #952 from bmish/npm-badge
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Mar 28, 2023
2 parents 1e5d3ae + f855494 commit 30d2220
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# ember-template-recast

[![NPM version](https://img.shields.io/npm/v/ember-template-recast.svg?style=flat)](https://npmjs.org/package/ember-template-recast)

With ember-template-recast, transform a template's AST and reprint it. Its
formatting will be preserved.

For instance, it is possible to change a component's property while preserving
its formatting:

```js
const recast = require('ember-template-recast');

Expand All @@ -32,12 +34,13 @@ output === `
/>
`; // is true!
```

## Command Line Usage

ember-template-recast comes with a binary for running a transform across multiple
files, similar to jscodeshift.

```
```sh
npx ember-template-recast directory/of/templates -t transform.js
```

Expand Down Expand Up @@ -130,6 +133,7 @@ although there are a few small extensions related to formatting
[in `custom-nodes.ts`](src/custom-nodes.ts)

Example:

```js
const { transform } = require('ember-template-recast');

Expand Down

0 comments on commit 30d2220

Please sign in to comment.