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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ng-stassets

v0.0.14

Published

Preconfigured Express stassets server.

Downloads

59

Readme

Angular Stassets Servers

A collection of base servers for angular and stassets projects.

Use this package to create and configure an Express server that manages static files and configures API endpoints.

Example Usage

Add some configuration options to package.json.

package.json

{
  "name": "ng-stassets-test",
  "version": "0.0.0",
  "description": "",
  "main": "app.js",
  "dependencies": {
    "ng-stassets": "^0.0.0",
    "debug": "^2.0.0"
  },
  "author": "David Souther <[email protected]>",
  "license": "ISC",
  "stassets": {
    "root": "./src/client"
  },
  "routing": [
    "./src/server/**/route.coffee"
  ]
}

Set the global.root to understand file paths, pass package.json to the ng-stassets server of your choice, and call start on the server reference you get back.

app.js

global.root = __dirname;
require('ng-stassets/express')(require('./package')).start()

By default, stassets looks for a component-based project architecture, compiling Jade, Coffee, Javascript, Stylus, and CSS. See [stassets][stas] for more details.

src/client/index.jade

doctype
html
    head
        title Hello, ng-stassets-test!
    body
        h1 Hi there!

Define API routes. Any files matching the pattern in the routing URL will be required, expecting a function that takes a reference to an Express app and the config passed to the root ng-stassets load, in this case the entire package.json.

src/server/hello/route.coffee

debug = require('debug')('ng-stassets-test:help')
module.exports = (app, config)->
    app.get '/hello', (q, s, n)->
        s.send "Hello from #{config.name}"
    debug 'Attaching /hello'

Recognized Options

These options can be passed as an object to ng-stassets, though best practice for servers is to place them in package.json.

name

Required. The name for the app.

hostname

Optional. The hostname to server on. Will use HOST from the environment, or os.hostname() as a default.

port

Optional. Integer port to listen on. Defaults to 8080.

stassets

Optional. A configuration for the underlying stassets compiler. If false, completely disables stassets. For more information, see the stassets docs.

stassets.root

Required. The root directory for stassets client files, relative to global.root specified in the root js file. If an array, specifies the root directories for a cascading file system.

stassets.framework

Optional. One of "none", "ionic", or "bootstrap". "none" loads vanilla Angular. "ionic" loads Angular with Ionic styles, components, and themes. "bootstrap" does the same. In fact, this preconfigures the vendors key. Defaults to "ionic".

stassets.vendors

Optional. Additional vendor root directories and files.

routing

Optional. Array of glob paths. Any file matching that glob will be loaded and called as a function taking app, a reference to the application server, and config, a reference to this configuration object.

tls

Optional. If present, will configure the server to use SSL encryption for all connections. If true, will load TLS using default values.

tls.port

Optional. Port for HTTPS to listen on. Defaults to 8443.

tls.key

Optional. Path to server private key. Defaults to "#{global.root}/env/server.key".

tls.cert

Optional. Path to server public certificate. Defaults to "#{global.root}/env/server.crt".

Changelog

  • 0.0.14 20214-09-26 Bin script to generate cert. Env overrides config.
  • 0.0.13 2014-09-17 Loads hostname from platform or config.
  • 0.0.0 - 0.0.11 2014-09-11 Initial work; lots of iterative tweaks.

Roadmap

  • Hapi.js integration. Allow choosing Hapi or Express frameworks.