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

create-nodejs-project

v1.0.2

Published

An npm initializer to scaffold a node project and include basic tools like lint, testing, etc.

Downloads

269

Readme

Node.js Project Initializer

License version downloads

coverage build

An npm initializer to scaffold a node project and include basic tools like lint, testing, etc.

npm init <initializer> can be used to set up a new or existing npm package.
initializer in this case is an npm package named create-<initializer>, which will be installed by npx, and then have its main bin executed -- presumably creating or updating package.json and running any other initialization-related operations.
— Source: docs.npmjs.com

Requirements

  • npm >= 6.5
  • node >= 10.12.0

Usage

  1. Install the package as global
npm install -g create-nodejs-project
  1. Run the setup configuration
npm setup

You will be prompted for your Github information
If you do not have the information at the moment, you can keep it empty.
In order to create projects with Github integration, you will need to add the authentication information later. See Github Auth

  1. Create your project
npm init nodejs-project path/to/new/project

What it does

  1. Create the folder for the new project
  2. Guide you through a questionnaire to setup the project
  3. Initialize a git repository
  4. Copy the template files (src, eslintrc, gitignore, readme, etc)
  5. Create a Github repository
  6. Install eslint dependencies
  7. Install the selected testing dependencies
  8. Generate package.json with all the project details
  9. Commit and push the initial commit
  10. Generate the license file

About this package

Every time that I start a new project in Node.js, I hate to go to other project folder, copy files like eslintrc, editorconfig; install the same dependencies, create folder structure, etc.

With this in mind, the motivation to build this package started as a DRY (Do not repeat yourself) thing.

This package is intended to automated the initialization of new Node.js projects and with this have a new folder with everything ready to work, basically an scaffolding tool.

Future features

  1. Unit testing
  2. Options to create the project with parameters instead of questionnaire
  3. A good error handler
  4. Color for the console messages
  5. Improve the template structure (the one that is generated in the new project) to include unit test
  6. Option to questionnaire with all the default values
  7. Logic to handle multiple authentication files and multiple Github accounts

Configure Github Authentication

If you are planning to allow this script to create your Github repositories, is required to generate a Github Token.

  1. Visit https://github.com/settings/tokens.
  2. Click Generate new token.
 Token Description: (your computer name)
 Scopes:
     [X] repo
         [X] repo:status
         [X] repo_deployment
         [X] public_repo
         [X] repo:invite
  1. Click Generate token.
  2. Copy the generated string to a safe place, such as a password safe.
  3. Open Terminal and add the Github token.
# nano /YOUR-NODE_MODULES-PATH/create-nodejs-project/create-nodejs-settings.json

...
...
   "githubAuth": {
     "user": "YOUR_USER",
     "token": "YOUR_TOKEN"
   }
...
...