Skip to content

Commit

Permalink
docs: add usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Apr 6, 2023
1 parent 1d5d56c commit f4dbd48
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# npmrc
.npmrc formatter
# dotnpmrc
> `.npmrc` formatter
## Usage
```ts
import {formatNpmrc} from 'dotnpmrc'

const contents = formatNpmrc({
format: 'npm9',
scopes: [{
name: 'example',
registry: 'https://npm-registry.example.com/',
auth: 'base64-of-username-and-password',
authToken: 'npmToken.bearer',
alwaysAuth: true,
}],
root: {
registry: 'https://registry.yarnpkg.com'
}
})

await fs.writeFile('.npmrc', contents, {encoding: 'utf8'})
```

## License
[MIT](./LICENSE)

0 comments on commit f4dbd48

Please sign in to comment.