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

spine.app

v0.5.2

Published

Spine app generator

Downloads

158

Readme

##Introduction

Effortlessly generate Spine, CoffeeScript and Hem applications. Spine.App gives hooks your application up with some structure, CommonJS modules, and gives you some nice tools to help it grow.

##Usage

First step is to install the npm package. If you don't already have npm or NodeJS you'll need to install them first.

$ npm install -g spine.app

Then we can generate the initial application structure like this:

$ spine app my_app

Now we've produced a directory structure looking like:

my_app/.gitignore
my_app/.npmignore
my_app/Procfile
my_app/app
my_app/app/controllers
my_app/app/index.coffee
my_app/app/lib
my_app/app/lib/setup.coffee
my_app/app/models
my_app/app/views
my_app/app/views/sample.jade
my_app/css
my_app/css/index.styl
my_app/css/mixin.styl
my_app/lib
my_app/lib/jade_runtime.js
my_app/lib/jquery.js
my_app/package.json
my_app/public
my_app/public/favicon.ico
my_app/public/index.html
my_app/slug.coffee
my_app/test
my_app/test/specs

First let's navigate to our application, and install it's npm dependencies:

$ cd my_app
$ npm install .

These will be exported locally in the ./npm_modules folder. Now, let's install Hem, which will be in charge or bundling our application.

$ npm install -g hem

And to serve our application up:

$ hem server

This will boot up an server on port 9294. You can now start generating Spine controllers and models:

$ spine controller users
    app/controllers/users.coffee

$ spine model user
    app/models/user.coffee

Any application specific code should go in the app folder. Otherwise, generic code, should go in the lib folder.

Any CoffeeScript, Stylus, or Jade templates files inside the application will be automatically compiled when requested, you don't need to worry about compiling them manually. That is Hem's magic happening.

Hem will also bundle up all your JavaScript files, enclosing them in a CommonJS wrapper. This means that scripts in the app folder need to be CommonJS compliant (basically exactly like normal Node scripts). In other words, to use a module you'll need to require() it, and you'll need to explicitly export any global variables.

Guide = require("controllers/guide")

class App extends Spine.Controller
  elements:
    "#item": "item"

  init ->
    @guide = new Guide(el: @item)

# Explicitly export it
module.exports = App

Inside your HTML files, you need only require application.js and every module will be wrapped up and ready to be loaded. As you can see, the generated index.html kicks things off by instantiating app/app.coffee when the page loads.

var exports = this;
jQuery(function(){
  var App = require("app");
  exports.App = new App({el: $("#body")});
});