Giter Club home page Giter Club logo

npm-pkg's Introduction

Build

Node.js Package Information

A GitHub Action for retrieving information from a package.json file, similar to npm pkg get, with some extra โœจ.

๐Ÿ“– Use Case

Publishing a prerelease version of a package can be tricky. By default, npm publish ignores the prerelease identifier, and doesn't take into consideration the tag defined in the package's version field.

Using @geekyeggo/npm-pkg solves this by parsing the version.tag from the package.json file; for example, given a version of 1.2.3-beta.0, a workflow can access the tag directly:

npm publish --tag {{ steps.pkg.outputs.version-tag }}

โšก Usage

See action.yml

steps:
  - uses: actions/checkout@v4

  - uses: geekyeggo/npm-pkg@v1
    id: pkg

  # When version is "1.0.0-rc.1", the tag output will be "rc".
  - run: echo ${{ steps.pkg.outputs.version-tag }}

๐Ÿ“ฅ Inputs

Name Description
path Optional path to the package.json file; default "./package.json".

๐Ÿ“ค Outputs

Name Description
version-major Major version number
version-minor Minor version number
version-patch Patch version number
version-tag Tag parsed from the prerelease identifier, for example "beta"; default "latest".

Interested in more outputs? Consider creating a pull request. ๐Ÿ’™

npm-pkg's People

Contributors

geekyeggo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.