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

andalay

v0.1.3

Published

A data layer modelled on Backbone collection and models. For use with Angular JS.

Readme

Andalay

A data layer modelled on Backbone collection and models. For use with Angular JS.

Website

http://andalayjs.com https://github.com/newicon/andalay

Install

Or using package manager:

  • npm install andalay
  • bower install andalay

Goals

  • Form a data layer that syncs with a backend (default basic restful)
  • Creates a local object cache reducing server load. For example a collection.find(123) request would first search the local objects in the collection and if not found would then ask the server.
  • Makes working with collections of models easier
  • Enables active record style objects. Each item in the collection is in fact a model that can have convenience functions
  • Make it easy to locally search through collections and models

To Develop

  1. git clone [email protected]:newicon/andalay.git
  2. cd andalay
  3. npm install

To run the tests:

  • npm test - run through the tests once and exit.
  • karma start - runs the tests and reruns them when any development file is changed note you will need to install karma npm install karma -g

Overview

Andalay Has two core objects a Collection and a Model object. A collection represents a collection of Model objects.

Typical useage:

// We must specify Andalay as a dependacy on the angular app
var app = angular.module('myapp', ['Andalay']);

// Andalay forms the core workhorse for many services responsible for interacting with server side and client side data
app.service('TodoService', ['Andalay', function(Andalay){
	
	var TodoModel = Andalay.Model.extend({
		// model properties and functions
	})

	var TodoCollection = Andalay.Collection.extend({
		url:'/todos',
		model:TodoModel
	});

	return new TodoCollection();

}]);

We typically only need to return the collection from the angular service as we can access the model class via the collection.model property. However Andalay can support multiple model types in one collection. So your service might want to return these as well.

var myNewTodo = new TodoService.model({name:'my new todo'});

To populate the collection with models we need to fetch them from the server:

TodoService.fetch();

The above code will generate a GET /todos request and populate the collection. We can alos populate our model with data we already have by using a reset command.

TodoService.reset([{"name":"my first model"}, {"name":"My second model"}]);

We can also do this at initialisation:

var myNewCollection = new TodoCollection([{"name":"my first model"}, {"name":"My second model"}]);

To use this in angular we can do the following:

// in angular controller
$scope.todoService = TodoService;
$scope.todoService.fetch();
// in html
<div ng-repeat="todo in todoService.models">

The collections model property maintains an array of models Typically Collections and Models map to a rest style URL structures.

GET  /todos/    TodoCollection.fetch()
POST /todos/    TodoCollection.create() 
GET  /todos/1   TodoModel.fetch();
PUT  /todos/1   TodoModel.save();
DEL  /todos/1   TodoModel.destroy();

However you may not use them in this context always. As the following code will generate the correct request to create a new Todo Model.

var myTodo = new TodoModel({name:'My new todo'});
myTodo.save();

The above code would generate a request POST /todos/ {name:'My new todo'} It is important to note that Andalay expects the server to return the newly created object. A valid response would be: {"id":1, "name":"My new todo"}

The model will now contain an id property and subsequent calls to the save method will generate a PUT request to update the model.