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

aleph-box

v0.0.1

Published

No backend anything stubber aka Chance.js without all the parens

Downloads

12

Readme

aleph-box Build Status

The Aleph's diameter was probably little more than an inch, but all space was there, actual and undiminished. Each thing (a mirror's face, let us say) was infinite things, since I distinctly saw it from every angle of the universe.

-- Jorge Luis Borges

Reasoning behind this library

When working on client-side apps, which are either prototypes/POCs or are supposed to be thin clients, getting all the data from the server, the need for some random data to be used in code arise. There's a great lib Chance.js and there's a great service json-generator, which help greatly when in need of some random data for that matter, but you either need to know all the objects/properties you will need in advance, or you're going to use single object and call some methods on them.

aleph-box can be considered a plain chance.js wrapper based on ES6 Proxies, which gives you an opportunity to get random data by simply trying to access it in place, without need to call some methods or create new nested objects.

How to use

Installation for node.js

  1. Install library by running

     npm install sudodoki/aleph-box
  2. Require it in your code

     var Store = require('aleph-box')
     var store = new Store()

Installation for browser

  1. Install library by running

     bower install sudodoki/aleph-box
  2. Include bower_components/aleph-box/bundled.js into your page. You now have Aleph constructor globally available.

Usage

After instantiating Aleph constructor you will get object that will have either properties from standard API, like 'name', 'surname', 'bio', 'phone' or other nested Aleph objects (unless you assign something yourself). Thus, you can do something like

  var store = new Aleph();
  store.people
    .forEach(function(person){
      console.log(person.name + ' ' + person.surname);
    });

There's an example of using aleph-box together with AngularJS to display simple contact book. Be sure to run in compatible browser.

Compatibility

This library is impelemented using proxies, so it will run in environments, that have support for those. Generally speaking, it's Node behind --harmony flag and FF. This library also leverages harmony-reflect for getting some normalized goodies across different environments.

API

There's a mapping for property name in Aleph & which method would be called on chance library

Todos

There're some sort of roadmap I would like to see implemented to consider this thing done & usable, would appreciate some feedback and/or contributions.