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-hchiam-learning

v8.0.3

Published

Yeoman generator to create another of my learning repos

Downloads

16

Readme

generator-hchiam-learning

version HitCount

A Yeoman generator to create another of my learning repos.

Just one of the things I'm learning. https://github.com/hchiam/learning

Key files: index.js and templates folder

Using generator-hchiam-learning

npm install -g generator-hchiam-learning
mkdir learning-something
cd learning-something
yo hchiam-learning

You might need to install Node.JS and Yeoman first: npm install -g yo. After running yo hchiam-learning, you should get something like this template repo: https://github.com/hchiam/learning-something

Sub-generator

yo hchiam-learning:mini

There's tons of other generators you can use to get up and running faster

Just use the searchbar: https://yeoman.io/generators

Learn to build your own

Starting from this repo

git clone https://github.com/hchiam/generator-hchiam-learning.git
cd generator-hchiam-learning
npm install
# (customize code and files)
npm link
npm publish
cd ~/Desktop
mkdir learning-something
cd learning-something
yo hchiam-learning

Starting from scratch (not using this repo)

npm install -g yo
npm install -g generator-generator
mkdir generator-my-generator
cd generator-my-generator
yo generator
# (customize code and files)
npm link
npm publish
cd ~/Desktop
mkdir some-repo
cd some-repo
yo my-generator

If you want to create a generator for a private project

You can avoid accidentally publishing to npm. This field is set by default in the generated package.json:

"private": true

More info in the npm docs.

Some interesting scripts to consider

{
  ...
  "scripts": {
    "start": "open build/index.html",
    "build": "babel src/index.js --out-file build/index.js; parcel build src/index.html --out-dir build --no-source-maps --no-cache; rm -rf dist; rm build/src.*.js",
    "test": "jest --passWithNoTests",
    "lint": "eslint src/*.js --max-warnings=0",
    "fix": "eslint --fix src/*.js",
    "fast": "nodemon -e js,html -w src -x 'npm run lint; npm run test; npm run build; npm run start;'"
  },
  ...
}

Also consider using Cucumber Gherkin to connect "plain English" feature files to Cypress tests. Simple example: https://github.com/hchiam/learning-cypress/tree/master/cucumber#tutorial-to-try-out-combining-cucumberjs-and-cypress

Troubleshooting

You can update to the current version by running the global install command again: npm install -g generator-hchiam-learning

npm link has the side-effect of creating a folder like this: /Users/<username>/.nvm/versions/node/v10.13.0/lib/node_modules/generator-hchiam-learning (you might need to delete that folder if you get an error that references it when you try to run npm install -g generator-hchiam-learning)

A simpler alternative

https://github.com/hchiam/learning-template