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

jspg

v0.0.4

Published

JavaScript project generator

Downloads

2

Readme

JavaScript Project Generator

A command line tool to create new JavaScript projects.

Goals

The main goal is to create a standard JavaScript project structure. Creating a JavaScript project is a lot of times filled with impedances on which tools to use and how to structure a project. In this way, jspg is an attempt to remove these impedances. Moving from project to project will be easier as well. You will learning the code and not how to run the project. Customization within the contraints of the project is a goal here as well. For example, if you want to use a different linter, install it and update the lint npm script definition. That way the tool changes, but the use of a linter in your project does not. Using a different tool should not have to alter the way you interact with your project.

Inspiration

The main inspiration is ember-cli. I think the Ember team has done an excellent job on defining a consistent project structure and default tooling. I think the same experience should be brought to all JavaScript projects.

Installation

npm install -g jspg

Usage

jspg <app_name> - Creates a new JavaScript project. This is used for either creating a node or JavaScript library project jspg <app_name> -w - Creates a new JavaScript web project. This is used for defining a frontend project

Code

Designed so that you can write your code and tests in ES2015 JavaScript. jsx is allowed as well.

Tools

This project by default uses standard, popular tools for:

Scripts

Projects use npm to run scripts above:

  • npm run lint: runs linter
  • npm run build: runs builder
  • npm run dev: In web projects this runs development server. For library projects, this watches for changes and runs tests
  • npm run clean: cleans build folder
  • npm run test: runs tests
  • npm run docs: runs documentation generator

These are the defaults. If one wanted to change the tool used, the idea would be to:

  1. Add the tool to the project
  2. Update the existing npm script to use new tool (or create new npm script if new functionality)

This allows for the commands to stay consistent, but the functionality to change.

Structure

The structure of projects is defined below:

  • app/ - The src folder. This is where you would write your code
  • app/app.js - The entry point to your application.
  • app/<app_name> - This would be where all of your other code would go.
  • tests/ - The test folder. All of your tests would go here
  • tests/app-test.js - An example test for app/app.js
  • .babelrc - The babel configuration file
  • .gitignore
  • package.json - The project's package.json. This is also where the above npm scripts are defined.
  • build/ - Build ends up here when npm run build is executed. The files here would be what should be served or used for production
  • docs/ - Documentation ends up here when npm run docs is executed

Library projects include the following:

  • webpack.config.js - The webpack configuration

Web projects include the following:

  • app/index.html - The starting html page
  • app/<app_name>/styles.css - The styles for your application
  • webpack.config.base.js - The base webpack configuration. This is used to share configuration between dev and prod builds
  • webpack.config.dev.js - The development webpack configuration. This includes a development server and hot code reload functionality
  • webpack.config.prod.js - The production webpack configuration