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-tdp-js

v1.7.1

Published

A simple Yeoman generator for my JS projects

Downloads

4

Readme

generator-tdp-js

Overview

A simple Yeoman generator which is probably pretty specific to me (or you might call it "optinionated"), though you're of course very welcome to use it if it works for you.

Installation

See the Yeoman getting started guide. The NPM package name of this generator is generator-tdp-js.

Usage

Once installed, you can run:

yo tdp-js <options>

This generator will make some major assumptions (which work for me):

  • You're in a directory which is named for the project you want to create
  • Source control is git via github
  • You're happy to transpile your JS
  • You're going to run your JS in a modern environment (though you can change this easily afterwards)
  • You want data type checking both at build/compile and at run-time
  • You want to publish to NPM (and your account is named for your Github account)
  • You want to use Travis for your CI (and your account is named for your Github account)
  • You're currently authenticated with the correct GitHub credentials
  • You're using OSX or possibly a *nix (but probably not Windows)

There are a few options you can opt in/out from when generating your :

  • --description "<String: null>": a description to use in the package.json file
  • --license "<String" Apache-2.0>": a license to use,
  • --react <Boolean: false>: whether you want to install React and React-DOM (for e.g. server-side rendering) along with the React ESLint plugin
  • --version <SemVer: 1.0.0>: the version number you want to start at

Then it will configure/install the following, customised to use the containing directory name as the project name:

  • .babelrc file containing relevant Babel configuration
  • .eslintrc and .eslintignore files to configure ESLint
  • .gitignore a gitignore file to exclude files from source-control
  • .travis.yml Travis CI test configuration
  • changelog.md: a simple changelog markdown file
  • config: a directory containing a template config file
  • license.md file, as per the above yo option
  • package.json: NPM package.json file with correct package name and scripts:
    • A postinstall script which is set up to copy the (source-controlled) template config file to a (source-control-ignored) working config file - this helps avoid adding real config files (which probably contain sensitive info) to source-control
    • npm start: start your new application
    • npm run lint: lint your code, currently via ESLint and with my config
    • npm run vuln-scan: scan your dependencies with Snyk for known vulnerabilities
    • npm run build: buld your new application into dist/, via Babel to es2015-node6 with Flow data type processing and checking via babel-plugin-typecheck (this willl enforce data type checking at run-time, unlike most data type libs for JS - I am a big fan of this)
    • npm test: run unit tests, via AVA. This also creates a code coverage report using nyc (see below)
      • yo tdp-js:tests: create unit test files for exported library functions (run yo tdp-js:tests --help to show options)
      • npm run report: show the created code coverage report
  • readme.md file for Github (primarily)
  • script directory, containing the postinstall script
  • src directory which contains an index.js file and a lib/<project name>-lib.js library file which is import'd in the index.js file

It currently does not create a Github project repo (but maybe will do in the future - #12).

Project aims

  • Make my (dev) life simpler, faster & more reproducible
  • Automate all the things! (in a way which suits my dev flow/style)
  • Use as few direct dependencies as possible
  • Use as simple a build chain as possible (no Grunt, Gulp etc.)
  • No global NPM installs required for project specifics - i.e. babel, eslint, snyk etc. are installed and run locally

Prerequisites

  • NodeJS and NPM (NPM is included in the installers from nodejs.org)

Semver

This project aims to maintain the semver version numbering scheme.

Changelog

See the changelog file.

To do

See issues.

Contributing

Contributions are very welcome for fixes, improvements, new features, documentation, bug reports and/or ideas. Please create a Github issue initially so we can discuss and agree actions/approach - that should save time all-round.

The ideal way to receive contributions is via a Github Pull Request from the master branch. Please ensure that at least unit tests (you can run these via npm test) and if possible, linter rules (npm run lint).

If you find a sensitive, security issue with this application, please email me privately in the first instance: neil [dot] craig [at] thedotproduct [dot] org.

License

MIT license