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

enginemill

v1.8.0

Published

Making it easier to build the internet.

Downloads

42

Readme

Enginemill

npm version

Enginemill is a Node.js web development framework. The goal is to codify some opinions about how to structure a Node.js system and provide tools to make the development of your systems easier and more fun.

  • Bluebird for Promises.
  • Lodash (Underscore) too.
  • Filepath to work with the filesystem.
  • Yargs to parse command line options.
  • Moment to parse, validate, manipulate and display dates.
  • Numeral for Number formatting and manipulation.
  • An Object factory for composing mixins.
  • Serially load plugins you define and kicks off your app only when they have all loaded.
  • Comprehensive logging based on Bunyan.
  • Message and pattern based communication with Oddcast.
  • Promisified request wrapper for making HTTP requests.
  • Supports CoffeeScript out of the box, which is nice for config and plugin initialization files.

On The Web

Built by @kixxauth

Examples:

Here is an example of booting up a new Express.js web application:

In ./bin/start-server.js:

var enginemill = require('enginemill');

// Loads the filepath (https://github.com/kixxauth/filepath) module.
var path = enginemill.path;

var server = require('../server');

enginemill.load({
    appdir: path.create(__dirname, '..'),

    // Plugins (expected in appdir/initializers/).
    initializers: [
        'configs',
        'middleware',
        'routes'
    ]
})
.then(server.start)
.catch(function (err) {
    console.error('There was an error starting the server:');
    console.error(err.stack || err.message || err);
    process.exit(1);
});

In './initializers/configs.coffee' (configs plugin):

enginemill = require 'enginemill'
path       = enginemill.path

module.exports = (app) ->
    # app.environment is set with the --environment option, or the
    # NODE_ENV environment variable.
    app.configs.port = if app.environment is 'production' then 8080 else 3000

    # Set the public path to '../public'
    app.configs.public_path = path.create(__dirname, '..', 'public')

In './initializers/middleware.coffee':

express = require 'express'

module.exports = (app) ->
    app.API.httpApp = express()
    app.API.httpApp.use bodyParser.json()
    app.API.httpApp.use bodyParser.urlencoded({ extended: false })
    app.API.httpApp.use cookieParser()
    app.API.httpApp.use express.static(app.configs.public_path.toString())

In './initializers/routes.coffee':

dashboard = require '../presenters/dashboard'

module.exports = (app) ->
    app.API.httpApp.get '/', dashboard.get

In ./server.js:

var http = require('http');
var enginemill = require('enginemill');

// Loads Underscore/Lodash as 'U' symbol.
var U = enginemill.U;

exports.start = function (app) {
    var port = app.configs.port;

    // Set the port number in Express.
    app.httpApp.set('port', port);

    // Setup the server
    var server = http.createServer(app.httpApp);
    server.on('listening', U.partial(exports.onServerListening, server));
    server.listen(port);
};

exports.onServerListening = function (server) {
    var addr = server.address();
    console.log('Listening on %s:%s', addr.address, addr.port);
    console.log('press CTRL-C to stop');
};

Run the server with node ./bin/start-server.js --environment production;

Copyright and License

Copyright: (c) 2014 - 2016 by Kris Walker [email protected] (http://www.kixx.name/)

Unless otherwise indicated, all source code is licensed under the MIT license. See MIT-LICENSE for details.