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

@jchpro/nest-librarian

v0.2.1

Published

CLI for simplifying Nest.js library publishing

Downloads

6

Readme

Nest librarian

Helps with preparing built Nest.js libraries for publishing, very simple stuff.

Description

The CLI is a simple wrapper around Nest's build command, performing some common additional post-build steps.

Exported components might help you with building your own Nest CLIs.

Installation

npm i -D @jchpro/nest-librarian

I'm not a fan of installing too many CLIs globally, so in this document I'll be showing example commands run using npx, assuming that the package is installed locally in your project.

CLI usage

package.lib.json

Put this in your library root if you want to build the library using the CLI. The schema is the one of package.json, the name is changed in order to not confuse your IDE.

The file will serve as the base for creating output package.json. Whatever you put there will be present in the output file, with some caveats which will be described below.

Building libraries

npx nestlib build <libraryProject> <options...> 

Running npx nestlib help build will give you more information about the options, here's what the command does:

  1. Builds the library using nest CLI;
  2. Copies assets to the output library;
  3. Merges paths from the root package.json to the output one;
  4. Creates output package.json, reads dependency versions from the root one if that's what you want (described below);
  5. Deletes the tsbuildinfo file.

Reading dependency versions from root

If you'd like the dependency versions to be read from the root package.json, just set them to 0.0.0 in the package.lib.json:

{
  "dependencies": {
    "lodash": "0.0.0",
    "commander": "^11.1.0"
  }
}

In this example lodash will use the version from root, and commander will have ^11.1.0.

Exported components

Please refer to the code comments for additional information.

Library

Represents the library defined in the nest-cli.json file. Contains paths to significant files and some parsed configuration.

Project

Wrapper around nest-cli.json file, focusing on the libraries defined in the file. Contains instances of Library for each library in your workspace.

Utilities

There are few filesystem and other utilities available, once again - please refer to the code :)