# betajs

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

Latest version **1.0.245** (published 2023-12-04) · Apache-2.0 license · 358 weekly downloads

## Install

```sh
npm install betajs
pnpm add betajs
yarn add betajs
bun add betajs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.245 |
| Published | 2023-12-04 |
| First published | 2014-03-20 |
| Weekly downloads | 358 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | BetaJS |
| Maintainers | oliverfriedmann |

## Links

- npm: https://www.npmjs.com/package/betajs
- Repository: https://github.com/betajs/betajs
- Homepage: https://betajs.com
- Issues: https://github.com/betajs/betajs/issues
- npm.io page: https://npm.io/package/betajs

## Recent versions

- 1.0.245 (latest) — 2023-12-04
- 1.0.244 — 2023-08-16
- 1.0.243 — 2023-08-16
- 1.0.242 — 2023-03-13
- 1.0.241 — 2023-03-07
- 1.0.240 — 2023-02-17
- 1.0.239 — 2023-02-07
- 1.0.238 — 2022-12-22
- 1.0.237 — 2022-11-21
- 1.0.236 — 2022-08-30
- 1.0.235 — 2022-04-16
- 1.0.234 — 2022-04-07
- 1.0.233 — 2021-11-06
- 1.0.232 — 2021-10-18
- 1.0.231 — 2021-08-20
- … 129 more at https://npm.io/package/betajs/versions

## README

# betajs 1.0.245
[![Build Status](https://api.travis-ci.org/betajs/betajs.svg?branch=master)](https://travis-ci.org/betajs/betajs)
[![Code Climate](https://codeclimate.com/github/betajs/betajs/badges/gpa.svg)](https://codeclimate.com/github/betajs/betajs)
[![NPM](https://img.shields.io/npm/v/betajs.svg?style=flat)](https://www.npmjs.com/package/betajs)
[![Gitter Chat](https://badges.gitter.im/betajs/betajs.svg)](https://gitter.im/betajs/betajs)

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

```javascript
	<script src="betajs/dist/betajs.min.js"></script>
``` 

#### NodeJS

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

#### Compile

```javascript
	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

```js

	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

```javascript
  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);
    }
    
  });
```

```javascript
  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


```javascript
	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);
```



## Links
| Resource   | URL |
| :--------- | --: |
| Homepage   | [https://betajs.com](https://betajs.com) |
| Git        | [git://github.com/betajs/betajs.git](git://github.com/betajs/betajs.git) |
| Repository | [https://github.com/betajs/betajs](https://github.com/betajs/betajs) |
| Blog       | [https://blog.betajs.com](https://blog.betajs.com) | 
| Twitter    | [https://twitter.com/thebetajs](https://twitter.com/thebetajs) | 
| Gitter     | [https://gitter.im/betajs/betajs](https://gitter.im/betajs/betajs) | 



## Compatability
| Target | Versions |
| :----- | -------: |
| Firefox | 3 - Latest |
| Chrome | 18 - Latest |
| Safari | 4 - Latest |
| Opera | 12 - Latest |
| Internet Explorer | 6 - Latest |
| Edge | 12 - Latest |
| iOS | 3.0 - Latest |
| Yandex | Latest |
| Android | 4.4 - Latest |
| NodeJS | 4.0 - Latest |


## CDN
| Resource | URL |
| :----- | -------: |
| beta.js | [http://cdn.rawgit.com/betajs/betajs/master/dist/beta.js](http://cdn.rawgit.com/betajs/betajs/master/dist/beta.js) |
| beta.min.js | [http://cdn.rawgit.com/betajs/betajs/master/dist/beta.min.js](http://cdn.rawgit.com/betajs/betajs/master/dist/beta.min.js) |
| beta-noscoped.js | [http://cdn.rawgit.com/betajs/betajs/master/dist/beta-noscoped.js](http://cdn.rawgit.com/betajs/betajs/master/dist/beta-noscoped.js) |
| beta-noscoped.min.js | [http://cdn.rawgit.com/betajs/betajs/master/dist/beta-noscoped.min.js](http://cdn.rawgit.com/betajs/betajs/master/dist/beta-noscoped.min.js) |


## Unit Tests
| Resource | URL |
| :----- | -------: |
| Test Suite | [Run](http://rawgit.com/betajs/betajs/master/tests/tests.html) |



## Weak Dependencies
| Name | URL |
| :----- | -------: |
| betajs-scoped | [Open](https://github.com/betajs/betajs-scoped) |
| betajs-shims | [Open](https://github.com/betajs/betajs-shims) |


## 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

---
_Source: https://npm.io/package/betajs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
