DEV Community

Arnaldo Gabriel
Arnaldo Gabriel

Posted on

3 2

NPM Package Creation - µGuide

Note to self.

How to Publish

  1. Create an NPM account
  2. Create GitHub repo
  3. Clone repo with git clone <url>
  4. Inside the repo run: npm init
  5. Fill the required fields
  6. Push to Github: git push origin master
  7. Publish publicly: npm publish

Basic Commands

  • To publish a new version of the package: npm version 1.0.0 && npm publish
  • To see the current profile: npm profile get
  • To change a property: npm profile set <property> <value>
  • To get current local version: npm version
  • To update a specific package: npm install package@latest
  • To update if the version change is minor: npm update package

Whitelisting Specific Directories

This is useful to minimize the size of the package by not including unnecessary files present in the repo.

    {
      "name": "package-name",
      "main": "./lib/index.js",
      "files": [
        "/allowed-directory"
      ]
    }

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more