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

@mobilabs/spine

v2.0.3

Published

A tiny MVC framework inspired from Backbone.js

Downloads

35

Readme

Spine

NPM version GitHub last commit Github workflow Test coverage npm bundle size License

A tiny MVC framework freely inspired by Backbone.js.

Spine API

| Static Methods | Description | |:--------------------------|:-------------------------------------------------| | noConflict | returns a reference to this Spine object | | whoami | returns the name and the version of the library | | fetch | execute an HTTP request (GET, POST, PUT, DELETE) | | urify | extends an Uri with the query parameters |

Spine.Model API

| Methods | Description | |:--------------------------|:-------------------------------------------------| | Spine.Model({}) | returns a child constructor | | Empty Methods | | | $initialize | makes the init when the object is created | | $listen | listens for model events | | $parse | parses the downloaded object or bypass | | Public Methods | | | $get | returns the value of the passed-in property | | $getAll | returns an object with keys/vals of the model | | $set | sets or updates model property(ies) | | $remove | removes one or a set of model property(ies) | | $has | checks if the model has the passed-in property | | $fetch | retrieves a model from the server | | $save | sends a model subset (changed prop) to the server| | $delete | deletes a model from the server | | $urify | extends an Uri with the query parameters | | Public Events Methods | | | $on | listens for an event | | $one | listens for an event once | | $off | stops Listening the passed-in event | | $fire | fires an event | | $trigger | fires an event (alias) |

| Events | Description | |:--------------------------|:-------------------------------------------------| | change | fired by 'set' on model change | | change:prop | fired by 'set' on model property change | | remove | fired by 'remove' when all properties deleted | | remove:prop | fired by 'remove' when a property deleted | | load | fired by 'fetch' when model loaded from server | | save | fired by 'save' when model saved on server | | delete | fired by 'delete' when model deleted from server |

Spine.Collection API

| Methods | Description | |:--------------------------|:-------------------------------------------------| | Spine.Collection({}) | returns a child constructor | | Empty Methods | | | $initialize | makes the init when the object is created | | $listen | listens for model events | | $parse | parses the downloaded array of objects or bypass | | Public Methods | | | $get | returns a model from its cid or id | | $each | returns the models one by one | | $next | returns the next model from the given model | | $previous | returns the previous model from the given model | | $length | returns the number of models in the collection | | $empty | deletes a collection (not from server) | | $add | adds one or more objects to the collection | | $remove | removes model(s) from the collection | | $fetch | retrieves new models from the server and appends them to the collection | | $save | sends a collection subset (changed prop) to the server | | $delete | deletes a set of models from the server and collection | | $urify | extends an Uri with the query parameters | | Public Events Methods | | | $on | listens for an event | | $one | listens for an event once | | $off | stops Listening the passed-in event | | $fire | fires an event | | $trigger | fires an event (alias) |

| Events | Description | |:--------------------------|:-------------------------------------------------| | add | fired by the 'add' method for each added model | | addcomplete | fired by 'add' when all added | | load | fired by the 'fetch' method | | save | fired by 'save' when collection saved on server | | remove | fired by the 'remove' method for each model removed | | removecomplete | fired by the 'remove' when all removed | | delete | fired by 'delete' when model deleted from server |

Spine.View API

| Methods | Description | |:--------------------------|:-------------------------------------------------| | Spine.View({}) | returns a child constructor | | Empty Methods | | | $initialize | makes the init when the object is created | | $render | renders the view in the DOM | | Public Methods | | | none | | | Public Events Methods | | | $on | listens for an event | | $one | listens for an event once | | $off | stops Listening the passed-in event | | $fire | fires an event | | $trigger | fires an event (alias) |

Spine.Router

| Methods | Description | |:--------------------------|:-------------------------------------------------| | Spine.Router({}) | returns a child constructor | | Empty Methods | | | $initialize | makes the init when the object is created | | Public Methods | | | $navigate | updates the url or triggers a route | | $getLastRoute | returns the latest route stored in the history | | $stop | stops the router listening for hash changes |

Spine.History

| Static Methods | Description | |:--------------------------|:-------------------------------------------------| | start | starts recording the route history | | stop | stops recording the route history | | isHistoryRunning | returns the history state | | get | returns the route in the history stack | | push | pushes a route in the stack | | pop | removes the latest entered route and returns it |

Spine.Radio

| Static Methods | Description | |:--------------------------|:-------------------------------------------------| | on | listens for an event | | one | listens for an event once | | off | stops Listening the passed-in event | | fire | fires an event | | trigger | fires an event |

License

MIT.