Socket
Book a DemoInstallSign in
Socket

betajs-data

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

betajs-data

BetaJS-Data is a general-purpose JavaScript framework for handling RESTful operations and ActiveRecord abstractions.

1.0.184
latest
Source
npmnpm
Version published
Weekly downloads
9
-55%
Maintainers
1
Weekly downloads
 
Created
Source

betajs-data 1.0.184

Build Status Code Climate NPM Gitter Chat

BetaJS-Data is a general-purpose JavaScript framework for handling RESTful operations and ActiveRecord abstractions.

Getting Started

You can use the library in the browser, in your NodeJS project and compile it as well.

Browser

	<script src="betajs/dist/betajs.min.js"></script>
	<script src="betajs-data/dist/betajs-data.min.js"></script>

NodeJS

	var BetaJS = require('betajs/dist/beta.js');
	require('betajs-data/dist/betajs-data.js');

Compile

	git clone https://github.com/betajs/betajs-data.git
	npm install
	grunt

Basic Usage

The BetaJS Data module contains the following subsystems:

  • Query Engine
  • Data Store System
  • Model / Table System
  • Data-based Collections

Queries

  {
    "gender": "male",
    "age": {
      "$gt": 16
    },
    "first_name": {
      "$sw": "S"
    }
  }
  evaluate(query, {"gender": "female", ...}) === false
  evaluate(query, {"age": 16, ...}) === false
  evaluate(query, {"first_name": "Guybrush", ...}) === false
  evaluate(query, {"gender": "male", "age": 17, "first_name": "Simon"}) === true

Data Stores

   store.insert(instance).success(function (data) {
     // Instance was inserted, and the updated data of instance is data (including the id)
   }).error(function (error) {
     // Could not insert instance
   });
   store.query(query, constraints).success(function (iterator) {
     // Store was succesfully queried; the query result is an iterator over matched instances.
   }).error(function (error) {
     // Could not execute query
   });

Modelling

   var MyModel = BetaJS.Data.Modelling.Model.extend(null, {
   }, function (inherited) {
        return {
            _initializeScheme: function () {
                var scheme = inherited._initializeScheme.call(this);
                scheme.first_name = {
                    type: "string"
                };
                scheme.last_name = {
                    type: "string"
                };
                return scheme;
           }
        };
   });
   var myTable = new BetaJS.Data.Modelling.Table(store, MyModel);

Query Collections

   var tableQC = new BetaJS.Data.Collections.TableQueryCollection(table, query, options);
   var storeQC = new BetaJS.Data.Collections.StoreQueryCollection(store, query, options);
ResourceURL
Homepagehttps://betajs.com
Gitgit://github.com/betajs/betajs-data.git
Repositoryhttps://github.com/betajs/betajs-data
Bloghttps://blog.betajs.com
Twitterhttps://twitter.com/thebetajs
Gitterhttps://gitter.im/betajs/betajs-data

Compatability

TargetVersions
Firefox3 - Latest
Chrome18 - Latest
Safari4 - Latest
Opera12 - Latest
Internet Explorer6 - Latest
Edge12 - Latest
YandexLatest
iOS3.0 - Latest
Android4.4 - Latest
NodeJS4.0 - Latest

CDN

ResourceURL
betajs-data.jshttp://cdn.rawgit.com/betajs/betajs-data/master/dist/betajs-data.js
betajs-data.min.jshttp://cdn.rawgit.com/betajs/betajs-data/master/dist/betajs-data.min.js
betajs-data-noscoped.jshttp://cdn.rawgit.com/betajs/betajs-data/master/dist/betajs-data-noscoped.js
betajs-data-noscoped.min.jshttp://cdn.rawgit.com/betajs/betajs-data/master/dist/betajs-data-noscoped.min.js

Unit Tests

ResourceURL
Test SuiteRun

Dependencies

NameURL
betajsOpen

Weak Dependencies

NameURL
betajs-scopedOpen
betajs-shimsOpen

Main Contributors

  • Oliver Friedmann
  • Pablo Iglesias

License

Apache-2.0

Sponsors

  • Ziggeo
  • Browserstack

FAQs

Package last updated on 10 Mar 2021

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.