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

sundae

v0.6.1

Published

Rtf restful framework for node

Readme

sundae

Rtf restful framework for node

NPM version Build Status Talk topic

Intro

Sundae is a light weight api framework based on express, but more intesting than express.

A quick brief of router

app = sundae express()

# You can definitely declare the path to route
# Router support all methods exported from `methods` module (get/post/put/delete/options/etc...)
# The route pattarn is something like `app[method] path, to: {controller}#{action}`
app.get '/', to: 'home#index'

# Post method
app.post '/', to: 'home#create'

# Resource route
# Then you also got the `resource` function to do the above things more restfully
app.resource 'home', only: ['create', 'read']

# Router options
# Router support some options like
# `only`: Only use actions listed in the only option
# `except`: Omit the actions in except option
# `to`: Alias to `ctrl#action`
# `ctrl`: Controller name
# `action`: Action name
# The example below shows mapping a group of `user` restful apis to the admin controller
app.resource 'user', ctrl: 'admin'

A quick brief of controller

app = sundae express()

app.controller 'home', ->

  # Mixin permission functions
  @mixin require './mixins/permission'

  # Request should contain these params
  @ensure 'user-agent', only: 'index'

  # These filters will execute before controller.index action
  @before 'checkAgent'

  # We'll filter the useless key of the callback data
  @select '-useless'

  # This assembler function is declared in home mixer
  @after 'changeName'

  # This is a controller action
  # You can call this function through router
  @action 'index', (req, res, callback) ->
    callback null,
      welcome: 'Hello World'
      "user-agent": req.get('user-agent')
      useless: 'useless message'

  # This is a filter function looks like controller actions
  # You can call this function from router
  # But most time you shouldn't do this
  @action 'checkAgent', (req, res, callback) ->
    userAgent = req.get('user-agent')
    # If the first param of callback is not null
    # controller.index will not be called
    return callback(new Error('GOD! WHY ARE YOU STILL USING IE?')) if userAgent.match /MSIE/
    callback()

Router options

  • only only keep the specific actions
  • except without the specific actions

Decorator options

  • only only the specific actions will apply hooks
  • except all actions will apply hooks without the except actions
  • parallel hooks will be parallel executed, the default mode is series (execute one by one)

TODO

Changelog

0.6.1

  • Add req.getParams function to get the original param given by user

0.6.0

  • Support stand alone application build with sundae
  • Set app.request/response to an constructor when using sundae without express
  • Add has function on request

0.5.10

  • Add mask decorator;

0.5.8

  • Add least decorator.

0.5.0

  • Apply sundae on the application level.
  • New router, controller, action patterns.

0.4.0

  • remove express in dependencies, you should require express by yourself in application
  • change the initialize functions, for more infomation, check the 'examples' directory
  • remove cli mode

0.3.6

  • use some options in the resource directive, e.g. ctrl, action ...

0.3.3

  • fix expand of req.headers, req.cookies etc.

0.3.1

  • remove wrap of actions, every action will receive three arguments: req, res, callback

0.3.0

  • hooks do not apply on each action now, they are only bind to actions emit by router
  • embed err1st package

0.2.7

  • ignore lib directory in development mode

0.2.5

  • clone _before/_after actions when extends from parent class

0.2.2 ~ 0.2.4

  • give up using transfer option, it's not a good idea, find another way

0.2.1

  • check invalid params in router
  • error support for 404 and 500 response

0.2.0

  • change the statement of decorators

0.1.5

  • change router to singleton, add router _stack

0.1.4

  • fix post decorator bug

0.1.3

  • add assembler, post decorators
  • fix mixer loader

0.1.2

  • auto load mixers

0.1.1

  • add more comments in demo controllers
  • fix request reset params bug
  • fix cli init crash

0.1.0

  • new beginning of sundae framework