Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions workspaces/libnpmpublish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ A couple of options of note:
token for the registry. For other ways to pass in auth details, see the
n-r-f docs.

* `opts.forceAuth` - an object containing authentication credentials. Use this
when publishing with automation tokens or when `opts.token` alone doesn't work.
Example: `forceAuth: { token: 'your-token-here' }`. This is required in some
cases where the registry URL is not automatically detected.

* `opts.provenance` - when running in a supported CI environment, will trigger
the generation of a signed provenance statement to be published alongside
the package. Mutually exclusive with the `provenanceFile` option.
Expand Down Expand Up @@ -101,6 +106,18 @@ await libpub.publish(manifest, tarData, {
// Package has been published to the npm registry.
```

**Note:** When using automation tokens or if the `token` option doesn't work, use `forceAuth` instead:

```js
await libpub.publish(manifest, tarData, {
npmVersion: 'my-pub-script@1.0.2',
forceAuth: {
token: 'my-automation-token-here'
}
})
// Package has been published to the npm registry.
```

#### <a name="unpublish"></a> `> libpub.unpublish(spec, [opts]) -> Promise`

Unpublishes `spec` from the appropriate registry. The registry in question may
Expand Down
Loading