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

steeplejack

v3.2.0

Published

An easy way of making a Twelve Factor App in NodeJS

Downloads

27

Readme

Steeplejack

Gitter NPM Version NPM Downloads Node.js Version Build Status Code Quality Dependencies Dev Depedencies

An easy way of making a Twelve Factor App in NodeJS

What is Steeplejack?

The goal of this project is to write reusable applications, using reusable components in whatever flavour of JavaScript you want.

When creating a new project, you need to set up the same things over and over again - your data models and collections, your dependency injection, your HTTP server, your routing and your logging. With Steeplejack, this is all there by default allowing you to get straight into your coding.

This is not a framework, it is scaffolding for modules. It doesn't tell you how to write your software, it just lets you do it. You can use Express or Restify as your HTTP strategy or even one of your own. So long as it satisfies the strategy, it doesn't care.

Almost every application will require some form of data storage. It's likely there will be some form of user management too. In the most part, these will be the same across all your projects. So, write these as plugins and use them across multiple projects rather than write it afresh each time.

What makes the Twelve Factor App so great?

Pick any of the following reasons:

  • makes your software more robust
  • makes your software truly scalable
  • you can give true long-term support for your software
  • happier developers

Steeplejack adds to this by:

  • allowing you to reuse your code in the form of plugins
  • being stupidly easy to set up a new server
  • things needed in every piece of software - error logging, data modelling and routing - are provided out-of-the-box

Config

A litmus test for whether an app has all config correctly factored out of the code is whether the codebase could be made open source at any moment, without compromising any credentials.

Twelve Factor App: Config

A lot of developers still specify all the different config environments in their config file. That was great when we wrote PHP and there were only three instances; dev, test and live. The power of NodeJS comes from it's scalability - how scalable is it going to be if, every time the operations guy wants to add a new server at 2am, you need to get out of bed and add in a new environment in your config file?

Get rid of all the environments out of your config file and just have one (the development one, so you don't have to dig around each time you download from the repo). For all other deployments of your software, use environment variables. Then it's the deployer's responsibility to put in the right config and you can stay in bed.

Steeplejack offers a single config file that can be overwritten by either environment variables or command line arguments. The application then has one single source of truth with your config and it's your choice how to specify the deployment config.

Data Modelling

The Twelve Factor App is all about loose coupling to your attached resources. You might start by using MongoDB, but there will be a time when that isn't the best solution. If you're using something like Mongoose, you are tied-in to MongoDB regardless.

The data modelling in Steeplejack is all about the data - it doesn't care where you store it, if indeed anywhere. The data is designed to be used by your application and stored in a way you decide. If your model doesn't match your data store exactly, no problem. There is a loose link between the model and the storage.

When you're dealing with lots of models, you can create a collection. Maybe you get your data from multiple sources and want to sort it in the application. Steeplejack allows you to write a simple method to do that.

Why's it called 'Steeplejack'?

When I started thinking about a scaffolding project, I was watching a Fred Dibnah documentary. Fred was a great enthusiast of beautiful engineering. It struck me as a great metaphor for what I was trying to achieve. By trade, Fred was a steeplejack, so the name is a little nod to him.

Fred Dibnah

License

MIT License