Skip to content

Instantly share code, notes, and snippets.

@aggregate1166877
Last active July 4, 2023 05:45
Show Gist options
  • Select an option

  • Save aggregate1166877/2ca0624d4923f7357611a0c56d2901c9 to your computer and use it in GitHub Desktop.

Select an option

Save aggregate1166877/2ca0624d4923f7357611a0c56d2901c9 to your computer and use it in GitHub Desktop.

Revisions

  1. aggregate1166877 revised this gist Jul 4, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion NPM publishing intstructions.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    First, do whatever bundling you need to do, example:
    ```
    npm run build-prod
    npm run build-stuff
    ```

    Log into NPM:
  2. aggregate1166877 revised this gist Jul 4, 2023. No changes.
  3. aggregate1166877 revised this gist Jul 4, 2023. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions NPM publishing intstructions.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    First, do whatever bundling you need to do, example:
    ```
    npm run build-prod
    ```

    Log into NPM:
    ```
    npm login
  4. aggregate1166877 created this gist Feb 7, 2023.
    33 changes: 33 additions & 0 deletions NPM publishing intstructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    Log into NPM:
    ```
    npm login
    ```

    Check what will be uploaded. Ensure nothing sensitive is included.
    ```
    npm publish --dry-run
    ```

    Publish the package:
    ```
    npm publish
    ```
    _Note: you can add `--access=public` for scoped libs._


    To auto patch the version:
    ```
    npm version patch
    npm publish
    ```

    Alternatively:
    ```
    npm unpublish <packagname>@x.x.x-readme // The specific version readme that you want to update
    npm publish
    ```

    Further reading:
    * https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c
    * https://snyk.io/blog/best-practices-create-modern-npm-package/