Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

betajs

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

betajs

BetaJS is a general-purpose JavaScript helper module. It contains a variety of helper functions and classes.

latest
Source
npmnpm
Version
1.0.245
Version published
Weekly downloads
1.2K
-8.6%
Maintainers
1
Weekly downloads
 
Created
Source

betajs 1.0.245

Build Status Code Climate NPM Gitter Chat

BetaJS is a general-purpose JavaScript helper module. It contains a variety of helper functions and classes.

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>

NodeJS

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

Compile

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

Basic Usage

The BetaJS module contains a variety of low-level helper libraries, particularly:

  • Asynchronous behaviour and Promises
  • Object Orientation
  • Event Handling
  • Dynamic Lists and Collections
  • Dynamic Properties
  • Remote Method Invocation
  • String Manipulation and Templating
  • Binary Search Trees
  • Timers and Time
  • Iterators
  • Uris
  • State Machine and Abstract Routing

Properties


	var properties = new BetaJS.Properties.Properties({foobar: "initial value"});

	properties.set("foobar", "second value");

	var value = properties.get("foobar");
	// value === "second value"
	
	properties.of('change:foobar', function(newValue, oldValue) {
		console.log('The value of foobar has been changed from', oldValue, 'to', newValue);
	});

Object Orientation

  TestClass = BetaJS.Class.extend(null, {
  
    y: 0,
  
    fooBar: function (x) {
      console.log("Test Class Instance", "fooBar", x, y);
    }
    
  }, {
  
    staticFooBar: function (x) {
      console.log("Test Class", "staticFooBar", x);
    }
    
  });
  TestClass.staticFooBar(5);
  var first = new TestClass();
  first.y = 1;
  first.foobar(2);
  var second = new TestClass();
  second.y = 3;
  second.foobar(4);
  Test Class  staticFooBar  5
  Test Class Instance  fooBar  2  1
  Test Class Instance  fooBar  4  3

Events

	var events = new BetaJS.Events.Events();

	events.trigger("event_name", event_data1, event_data2);

	events.on("event_name", function (event_arg1, event_arg2) {
		// Do something
	}, function_context);

	events.off("event_name", null, function_context);
ResourceURL
Homepagehttps://betajs.com
Gitgit://github.com/betajs/betajs.git
Repositoryhttps://github.com/betajs/betajs
Bloghttps://blog.betajs.com
Twitterhttps://twitter.com/thebetajs
Gitterhttps://gitter.im/betajs/betajs

Compatability

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

CDN

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

Unit Tests

ResourceURL
Test SuiteRun

Weak Dependencies

NameURL
betajs-scopedOpen
betajs-shimsOpen

Main Contributors

  • Oliver Friedmann
  • Victor Lingenthal

License

Apache-2.0

Credits

This software may include modified and unmodified portions of:

  • Underscore, MIT Software License, (c) 2009-2013 Jeremy Ashkenas, DocumentCloud
  • parseUri, MIT Software License, (c) Steven Levithan

Sponsors

  • Ziggeo
  • Browserstack

FAQs

Package last updated on 04 Dec 2023

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