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

slush-js

v2.3.0

Published

A Slush generator for clientside and serverside JS projects

Downloads

38

Readme

slush-js

A Slush scaffolder that generates JS projects for you (clientside, serverside, both clientside and serverside, or standalone lib).

The generated project has live reloading on code changes (for both clientside and serverside, as applicable). The live reloading has been tweaked to be very fast to maximise productivity.

The stack is chosen to use as standard, vanilla technologies as possible. You write all your JS as normal JS (with ES6+ support). You write all your CSS as normal CSS (with CSS4 support). You also get all the conveniences of a modern stack with the productivity of a build system.

The stack uses npm scripts to drive the build targets using the CLI of several packages.

Stack

  • npm script for build tasks
  • ESLint for linting JS
  • Stylelint for linting CSS
  • Mocha & Chai for testing
  • Client (or standalone lib)
    • JS
      • Webpack for bundling with CommonJS require() support and ES import support
      • Babel for transpiling and polyfilling ES6+
      • Browsersync
        • Support for live reloading the UI when the code is changed
        • Support for testing on multiple browsers or multiple devices simultaneously (config UI at http://localhost:3002 when running npm run watch)
      • UglifyJS to compress built JS
      • React (optional)
    • CSS
      • PostCSS to add features to CSS
      • postcss-import to allow @imports to be bundled
      • postcss-url to allow files referenced by url() (images, fonts, etc.) to be bundled in CSS for performance
      • postcss-cssnext to allow for future CSS features (things that LESS and SASS introduced) to be used and to allow for CSS to be automatically patched to support older browsers
      • cssnano to compress built CSS
      • Normalize.css to make the default stylesheet more consistent across browsers
      • A minimalistic base stylesheet that can be configured with CSS variables (taken from Factoid; may make sense to make this a reusable npm module)
  • Server
    • Express for a fast, modular, minimalistic server that can be used to serve pages and/or services
    • Forever to make the server automatically restart on crashes
    • Nodemon to bring live reloading functionality for serverside code when developing

Notes

  • Don't use ES2015 import if you want to share code between the server and the client. You can't use import in Node.js. Node 8 support import. Once Node 8 and npm 5 are stable, it makes sense to use import.
  • Debug Mocha tests or server code with node --inspect --debug-brk or mocha --inspect --debug-brk
    • --inspect to start the debugger UI
    • --debug-brk to break on the first line so you have time to open the debugger
  • Do not use Webpack to import or require() your CSS from inside your JS. Do not use Webpack to bundle CSS into your JS bundles. If you do that, you can no longer share code between the client and the server.

Instructions

  1. Install slush : npm install -g slush
  2. Install slush-js : npm install -g slush-js
  3. Scaffold : slush js

Scripts

The generated project uses npm scripts to drive all of the build process so that nothing needs to be installed globally with npm. (Only slush has to be globally installed, and only when first generating the project.) The targets are described in the generated README.md file.