Socket
Socket
Sign inDemoInstall

aleph-box

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aleph-box

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


Version published
Weekly downloads
7
decreased by-50%
Maintainers
1
Install size
378 kB
Created
Weekly downloads
 

Changelog

Source

0.0.1 - 2014-09-03

Added

  • CHANGELOG, README, LICENSE
  • package.json
  • initial library implementantion, that provides next bindings
  • add inital test suite
  • add html sandbox that can be used

Readme

Source

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

Aleph's Logo

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.

Keywords

FAQs

Last updated on 03 Sep 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc