1.10.4 ā€¢ Published 7 months ago

@jsenv/package-publish v1.10.4

Weekly downloads
46
License
MIT
Repository
github
Last release
7 months ago

Package publish npm package

Publish package to one or many registry.

Presentation

  • Can be used to automate "npm publish" during a workflow
  • Allows to publish on many registries: both npm and github registries for instance.

You can use it inside a GitHub workflow or inside any other continuous environment like Travis or Jenkins.

Screenshot taken inside a github workflow when the package.json version is already published: already published github workflow screenshot

Screenshot taken inside a github workflow when the package.json version is not published: publishing github workflow screenshot

Installation

npm install --save-dev @jsenv/package-publish

Documentation

The api consist into one function called publishPackage.

publishPackage is an async function publishing a package on one or many registries.

import { publishPackage } from "@jsenv/package-publish"

const publishReport = await publishPackage({
  rootDirectoryUrl: new URL('./', import.meta.url)
  registriesConfig: {
    "https://registry.npmjs.org": {
      token: process.env.NPM_TOKEN,
    },
    "https://npm.pkg.github.com": {
      token: process.env.GITHUB_TOKEN,
    },
  },
})

rootDirectoryUrl

rootDirectoryUrl parameter is a string leading to a directory containing the package.json.

This parameter is required.

registriesConfig

registriesConfig parameter is an object configuring on which registries you want to publish your package.

This parameter is required.

logLevel

logLevel parameter is a string controlling verbosity of logs during the function execution.

This parameter is optional.

ā€” see also https://github.com/jsenv/jsenv-logger#loglevel

1.10.4

7 months ago

1.10.3

8 months ago

1.10.2

1 year ago

1.10.1

1 year ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.5

2 years ago

1.10.0

2 years ago

1.7.3

2 years ago

1.7.4

2 years ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.2

3 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago