npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@seges/angular-language-picker

v2.0.3

Published

For the time being the project scaffold expects TypeScript files.

Downloads

85

Readme

How to create and publish NPM modules.

For the time being the project scaffold expects TypeScript files.

For a full documentation of npm usage and commands see https://docs.npmjs.com

New project

This describes how to create a new module from scratch. If you want to fork an existing project (recommended for new npm modules), see the step "Forking a project" further down.

  1. Create a Git repository.
  2. Clone the newly created repository to a folder on your machine.
  3. Create a folder in the project named src, all the source code will go here.
  4. Run npm init from a console window (cmd/bash etc.) in the project root and follow the steps displayed to create package.json.
  • Ensure that the package name is prefixed with @seges.
  1. Create an index.ts (TypeScript) or index.js (JavaScript) file depending on what language you wish to use.
  2. In the index file, export the modules from the src folder that you wish to expose.
  3. Run npm publish from the root of the project (double check that the project name in package.json has @seges/ as prefix, otherwise the package is published outside the seges organization scope).
  • Scoped packages are private by default, to make it public, run npm publish --access public instead.
  1. Remember to also checkin changes in Git.

Now the module should be available for installation by running npm install <name-of-your-package> from any other project.

Updating an existing package.

  1. Checkout the module's Git repository.
  2. Perform your needed changes.
  3. When done with your changes run npm version major|minor|patch -m <message> from the root of the project.
  1. Publish your package by running npm publish or npm publish --access public.
  2. Remember to also push changes to Git.

The module should be updated.

Logging in to http://www.npmjs.org you should be able to find and see the new version of the updated package.

Unpublishing a package

In general you should not unpublish packages as other projects might depend on them.

Instead you should update the package with a new version containing fixes of the broken version by following the steps above.

But in the event you need to unpublish, you can run npm unpublish <@scope/><package name>@<version> to unpublish that version.

Note that even though a version is unpublished, a new publish of the same version is not possible unless the entire project is taken down.

Forking a project

The SEGES_NPM project can be used as a scaffold or base for a new npm module as it contains various necessary files required to run unit tests.

To fork a project:

  1. Create a new git repository.
  2. Check out the SEGES_NPM project.
  3. Open a console at the root of the SEGES_NPM project.
  4. Run the command git remote set-url origin <url-of-the-project-created-in-step-1>
  5. Run the command git push origin master
  6. Rename your root project folder to the name of the repository created in step 1.

OR

  1. Remove the project locally and checkout the repository created in step 1.

Run through the package.json and remove comments, as they are not valid JSON.

You should now have a new project with the contents of SEGES_NPM.