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-mnm

v0.6.0

Published

Create node modules writing ES6 today compiled with Babel, tested with ava and linted with standard on top of npm scripts Create node modules with es6, test with tape on top of npm scripts

Downloads

5

Readme

Install

$ npm install -g yo generator-mnm

Usage

Usage:
  yo mnm:app [options] [<name>]

Options:
  -h,   --help          # Print the generator's options and usage
        --skip-cache    # Do not remember prompt answers             Default: false
        --skip-install  # Do not automatically install dependencies  Default: false
  -a,   --all           # Ask all questions                          Default: false
  -y,   --yes           # Skip some questions, like $ npm init -y    Default: false

Arguments:
  name  # module name
  If provided the module will be created inside ./<name>/
  otherwise it will be created in the current directory

  Examples:

     $ yo mnm
     $ yo mnm myAwesomeModule

    Type: String  Required: false

Example

$ yo mnm -y
   create package.json
   create README.md
   create .gitignore
   create src/index.js
   create test/index.js
   create .travis.yml
   create .babelrc
   create rollup.config.js

Features

  • Made out of many other generators, the main generator only creates a package.json file and a minimal .gitignore file
  • Composable, since the logic to create the README, cli and other files is on their own subgenerator
  • Babel transpiles the code/tests
  • standard to lint the code
  • ava for testing
  • yargs to parse cli arguments (optional)
  • rollup to create a common js compatible bundle
  • npm scripts as the build system

Example

Check https://github.com/maurizzzio/generator-mnm-example

List of npm scripts included

Common tasks

| task | description | | ----- | --- | | npm test | ava | | npm run build | rollup --config| | npm run lint | standard | | npm run clean | Removes all the files inside dist/|

Watching files

| task | description | | --- | --- | | npm run test:watch | Same as npm test but with --watch | | npm run build:watch | Same as npm run build but with --watch |

Pre/Post hooks

| Task | description | | --- | --- | | npm run prebuild | Run before build, npm clean -s && npm lint -s | | npm run preversion | Run before version, npm run build |

Useful npm commands that you should know

  • npm version major|minor|patch bumps the package version
  • npm run lists all available scripts

Why?

This project is heavily inspired by this article by Keith Cirkel where he describes that the existing build system tools attempt to solve the problems that exist among them "covering up the inadequacies of the other tools while also surfacing their own".

James Halliday who is the creator of many awesome packages like browserify and tape also wrote an article where he points out that the command npm run is "perfectly adequate for everything while maintaining a very tiny configuration footprint."

Articles to read:

Inspiration projects

  • https://github.com/yeoman/generator-node
  • https://github.com/vinniegarcia/ES6-module-starter
  • https://github.com/sindresorhus/generator-nm
  • https://github.com/bucaran/generator-rise
  • https://github.com/iamstarkov/generator-zen
  • https://github.com/keithamus/npm-scripts-example 's awesome package.json file

I'd like to thank iamstarkov for his awesome work on generators that are actually composable

Composability

Just plug in any of the subgenerators or the app generator itself on your generator

Generators used in this project

Workflow

# equivalent to npm init -y
yo mnm -y
# see https://www.npmjs.com/package/ghrepo
ghrepo -m "initial commit"
# see https://www.npmjs.com/package/travisjs
travisjs hook # or travis enable with the travis gem

# if a cli is needed
yo mnm:cli

Development

  • npm test
  • npm test:ci run the tests (open ./test/ci/.tmp to see a generated)

License

2015-2016 MIT © Mauricio Poppe