Skip to content

Commit

Permalink
Add examples to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Obweger committed May 3, 2020
1 parent ef1d87f commit c7062b2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@ $ npm install plugin-name-to-package-name
```js
const { transform } = require('plugin-name-to-package-name');

console.log(transform('@foo/bar', 'some-plugin')); // @foo/some-plugin-bar
console.log(transform('@foo/bar', 'eslint-plugin')); // @foo/eslint-plugin-bar
```

## Usage

`transform` takes two parameters; the `pluginName`, and the `pluginPrefix`. In the above example, `pluginName` is `'@foo/bar'` and `pluginPrefix` is `some-plugin`.
`transform` takes two parameters; the `pluginName`, and the `pluginPrefix`. In the above example, `pluginName` is `'@foo/bar'` and `pluginPrefix` is `'eslint-plugin'`.

### Examples

| `pluginName` | `pluginPrefix` | Result |
|-|-|-|
| `@foo` | `eslint-plugin` | `@foo/eslint-plugin` |
| `bar` | `stricter-plugin` | `stricter-plugin-bar` |
| `@foo/bar` | `modster-plugin` | `@foo/modster-plugin-bar` |


## Contributions

Expand Down

0 comments on commit c7062b2

Please sign in to comment.