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

atlas-npm-init

v1.1.4

Published

A CLI tool for generating npm projects and necessary boilerplate.

Downloads

15

Readme

atlas-npm-init

A CLI tool for generating npm projects and necessary boilerplate.

Travis


install

npm install -g atlas-npm-init

why

I wanted to get the hang of abstracting things into packages, and I found the boilerplate work to be excessive (even with npm init) and 99% the same in every case. To me, this screams "automate me". Now, I can just run npm-init and fill out some questions (or use args) and I can immediately get to writing my code.

This package will generate a project with chai, mocha and some minimal boilerplate installed.

examples

using the cli tool

with args

You can specify a name, description, and author. At least one field is required, the rest are optional:

npm-init -n my-app -d "my description" -a "atlassubbed <[email protected]>"

without args

If you don't specify any args, you will be prompted to enter the name, description and author. In this case, all responses are optional. If you don't specify a name, it will default to "npm-package":

npm-init

specifying an author

If you specify a full author (with a name and email), the generator will automatically initialize a repository and perform an initial commit.

the generated project

structure

  npm-package/
    src/
      index.js
    test/
      index.test.js
    .travis.yml
    .gitignore
    LICENSE.md
    README.md
    package.json

scripts

You'll be provided with two scripts to run your tests:

  1. npm run test-server: pretty mocha test output to CLI with hot-rerun.
  2. npm test: pretty mocha test output to CLI.

npm install

Once you've generated my-app, all you need to do is:

cd my-app
npm install

todo

I'd like to have a global executable called atlas which has the following sub-commands:

  1. npm: generates a minimal npm starter app.
  2. webpack: generates a minimal webpack starter app.
  3. repo: automatically sync your project to github or fork/clone existing projects.
  4. logout
  5. whoami
  6. ~~login~~: Not needed, thanks to atlas-recursive-auth

As of right now, the atlas command only has subcommands 3 and 4 above. atlas-npm-init (this package) and altas-webpack-init are their own commands, but I'd like to turn them into 1 and 2 above, respectively. The atlas command should then be responsible for initializing pretty much everything in a new project.

caveats

license

LICENSE.md defaults to MIT. Currently, there's no option to change it from the CLI. Changing it manually would simply require editing a line in package.json and editing the LICENSE.md file itself.

sinon and sinon-chai

When I was writing this package, I included sinon and sinon-chai, but I removed them because I found myself not using them in my tests. sinon is great, but why don't I use it? Spying, stubbing and mocking is pretty easy without it.

git initialization

Currently, the generator will automatically initialize a repo and make the first commit if you specify a full author. There's no way to turn this off right now. I understand that this can be undesirable, but I always needed these steps, so I figured it would just be a default.