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

superjs-starter

v0.1.0

Published

SuperJS Starter Application

Downloads

2

Readme

##SuperJS Starter App A simple starting point for a SuperJS application. Everything in SuperJS is class-based and extendable with the _extend method. See the SuperJS documentation for more information: http://github.com/asleepinglion/superjs

####Installing the Application:

  • Clone the Starter Repository
  • Run npm intall to install required modules
  • Update the config/data.js settings to point to a real database
  • Create a real module in the modules folder which reflects an actual table
  • Run node app.js

####Testing The API:

By default security is disabled and all REST routes are publicly available. Content-type application/json is required on POST, PUT, and DELETE requests. All REST routes have RPC routes that match, for example a GET on a table is also available at http://127.0.0.1:8888/yourtable/search and a POST is also available at http://127.0.0.1:8888/yourtable/create.

  • GET http://127.0.0.1:8888 to check if the server is up.
  • GET http://127.0.0.1:8888/describe to describe available controllers and methods.
  • GET http://127.0.0.1:8888/yourtable to get the contents of yourtable
  • POST http://127.0.0.1:8888/yourtable to create a new yourtable record.
  • PUT http://127.0.0.1:8888/yourtable to update a yourtable` record

###Basic Structure

#####app.js The application starting point contains the instantiation of the SuperJS.Application class. The class could be extended to override functionality, such as the middleware loaded. You can also hook into events such as the started event.

#####config There are three configuration files, data, security, and server settings. Please check those files for more detailed descriptions.

#####modules You can either create modules inside the module folder by naming a folder after the module, such as user and then inside that folder have a controller.js and a model.js OR you can have controllers and models folders which contain files like user.js. Larger applications will probably prefer the modules method, but this is user preference.

#####models Models define the available models for the API. The configuration of models is dependent on the engine used. See the data.js configuration file for more information.

#####controllers Controllers are entirely extendable and routes are automatically created. Any method beginning with an underscore is essentially private and unroutable and any regularl method will have a route created for it. Methods that are web accessible will receive two params, the req object provided by express, and a callback which needs to be called at the end of your method otherwise the process will be blocked. Controllers are entirely extendable, so you can create base classes and abstract common functionality. There is a base Controller class available in the SuperJS package or you can use the Rest Enabled controller classes provided by the database engine. You can also hook into events such as the beforeAction and afterAction events.