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

generator-angular-library

v4.0.1

Published

Generate an angular 5.0+ scaffolding suitable for publishing a re-usable library to npm

Downloads

30

Readme

generator-angular-library Build Status

Simply scaffold your angular 5.0+ library with this yeoman generator and start writing code without having to setup any tedious boilerplate tooling.

Everything is pre-configured, from a local development server with unit tests, through to publishing your library to npm and a demo to github pages. Hopefully the angular-cli project will one day make this generator obsolete, however currently the angular-cli is geared towards creating a full web-app rather than just a single re-usable npm library.

Installation

First, install Yeoman and generator-angular-library using npm (we assume you have pre-installed node.js).

npm install -g yo generator-angular-library

Then create your new repo on github, check it out and from the root of the repo folder run:

yo angular-library

Folder structure

  • src should hold your libraries components / services / pipes etc. Organise them however you see fit!
  • test contains all your libraries test files. Simply suffix the filenames with .spec.ts and they will be auto-included and ran
  • demo contains a demo app that shows off your library to users. It is also handy during development as unit tests will only get you so far when developing a UI component

npm scripts

Once you've scaffolded out your library, everything is then controlled by npm scripts:

  • npm start to serve the demo page of your library with live-reload as you develop. Unit tests are also run in the background.
  • npm test will run your unit tests once and npm run test:watch will run them continuously
  • npm run commit will run the git commit wizard when you're ready to commit a change
  • npm run release will publish a new release. First make sure you've created the gh-pages branch and pushed it to github. Next change the version in package.json to the new version you would like to release, but don't commit it yet. Now run npm run release and the new version will be built and published to npm, as well as the demo and documentation generated and pushed to the gh-pages branch of your project.

Tools used

License

MIT © Matt Lewis