open-index/open-npm huggingface dataset:
npm package: @perreh/js-calculator
Description: Calculator Module for JS
Author: Perry James Steward
Latest version: 1.0.6

# JS Calculator

A lightweight javascript library for parsing calculations as an example for the revealing module pattern and testing with Jasmine.


## Usage

In a browser using CDN:
```html
<script src="https://unpkg.com/@perreh/js-calculator@1.0.6/dist/calc.bundle.js"></script>

<script>
    calc(3).add(5); //returns 8
</script>
```

Using npm:
```shell
npm -i --save @perreh/js-calculator
```

In Node.js
```js
var calc = require('@perreh/js-calculator');

calc(3).add(5); //returns 8
```

## Building

Take a copy of the code if you want to make changes or build the bundle yourself. **eslint** is used in the build to test code against a style guide.

```shell
git clone https://github.com/perryjsteward/js-calculator.git
cd js-calculator
npm install
npm build
```

build will bundle the file into `/dist`

## Testing

Test the package using Jasmine against original index.js:

```shell
npm run test
```

To test a specific spec file (`-- --` is not a typo):

```shell
npm test -- --filter="Calculator Minus"
```

## Authors

* **Perry Steward** - *Initial work* - [PerryJames](https://github.com/perryjsteward)

See also the list of [contributors](https://github.com/perryjsteward/js-calculator/graphs/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* Exercise Inspired by [DevLeague](https://github.com/devleague/js-calculator)
* Pattern Inspired by [MomentJS](https://github.com/moment/moment/)
npm package: @perrinjerome/theia-open
Description: A theia extension to open files from command line
Author: Jérome Perrin
Latest version: 0.5.0

# theia-open

A [theia](https://github.com/eclipse-theia/theia) extension to open files from command line.

This exposes a server side API to open/close and editor and query if the editor is still open and a command line interface.

This is intended to use as an `$EDITOR` environment variable so that opening files from the terminal (for example with `git commit`) opens in a theia editor.

This is a reimplementation of a [gitpod](https://gitpod.io/) feature.

# Usage

Start theia server with a token set as environment variable `THEIA_OPEN_EDITOR_TOKEN`.
Client will need the same token to connect.

Install client:
```
npm install -g @perrinjerome/theia-open-cli
```

Set `EDITOR` environment variable in the shell, something similar to:
```bash
export THEIA_URL=http://localhost:3000
export EDITOR="theia-open --wait"
```

# Demo

```bash
# install and build everything
yarn install
yarn build # during development use yarn watch instead

# run the example theia app
cd browser-app
yarn demo
```
This will start theia on http://localhost:3000 , with the necessary environment variables set (see the `demo` command in `browser-app/package.json`).

When running git commands from theia's terminal, theia's text editor will be used instead of a default command line text editor.
Try for example: `git config --edit --global`.
npm package: @perry-rylance/data-table
Description: This library handles client and server side record fetching, including search, sort and pagination.
Author: Perry Rylance
Latest version: 1.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# DataTable

This library handles client and server side record fetching, including search, sort and pagination.

This is the client side component. Feel free to write your own, or extend `PerryRylance.DataTable` by overriding `createInstance`.

If you're looking for the server side library, please see <https://github.com/PerryRylance/DataTable>

## Requirements

- jQuery

## Installation

I recommend installing this via NPM:

`composer require perry-rylance/datatable`

## Usage

- Use import or require to load the module
- You can let the module take care of everything

## Integration

- You can simply use the DataTable (native) JS interface to interact via the table element and let this library handle the communication.
- If you wish to implement custom behaviour, please make a class which extends DataTable, and then override DataTable.createInstance to return an instance of your class.
npm package: @perry-rylance/event-dispatcher
Description: A lightweight ES6 event dispatcher which supports bubbling, capture phases and bubbling to the DOM tree.
Author: Perry Rylance
Latest version: 1.0.3

# EventDispatcher
A JavaScript event dispatcher which supports bubbling and capture phases, and bubbling up the DOM tree.

This library is intended to be used with NPM / ES6 projects.

## Installation
I recommend installing this library via NPM

`npm install @perry-rylance/event-dispatcher`

## Usage
Any class which `extends EventDispatcher` can use the following methods

- addEventListener / on
- removeEventListener / off
- dispatchEvent / trigger / emit
- hasEventListener

## Bubbling
When an object emits an event, the event dispatcher will look for a `parent` property on the object.

The dispatcher will then traverse up the ancestors of the object this way, until no more `parent` is found.

In the absense of a `parent`, if the dispatcher finds a property named `element`, then a DOM event will be dispatched on the element via jQuery (please note that jQuery is required to drive this behaviour). This is useful for events emitted from an object with no DOM representation, such as a sprite on a canvas, which you may wish to listen for on the DOM tree - for instance a click event on your sprite.

When an event bubbles up to the DOM, a namespace suffix is added, for instance `click.ed`. The default suffix is `ed`. You can change this by altering `EventDispatcher.domNamespaceSuffix`, or by passing the `domNamespaceSuffix` in the constructor options for individual event dispatchers, if you so wish.
npm package: @perry-rylance/midi-to-milliseconds
Description: TypeScript library for resolving MIDI event times to milliseconds. Useful for syncing things like graphics to MIDI.
Author: Perry Rylance
Latest version: 1.0.6

# MIDI to milliseconds
This library provides a `TimeResolver` class that yields `TimeResolvedTrack`s and `TimeResolvedEvent`s from a MIDI file.

For use with [this MIDI package](https://github.com/perryrylance/midi).

## Installation
`npm install @perry-rylance/midi-to-milliseconds`

## Usage
You'll need a MIDI file with one or more tracks loaded up, see [@perry-rylance/midi](https://www.npmjs.com/package/@perry-rylance/midi).

```
const resolver = new TimeResolver(midi);
const track = resolver.tracks[0];
const events = track.getEventsBetweenMilliseconds(0, 1000);
```

`events` will be an array of `TimeResolvedEvent` objects, containing the events resolved absolute ticks and milliseconds in `absolute` and the original event in `original`.

This is useful for tasks such as syncing animations to MIDI. If track milliseconds for the previous frame versus milliseconds at the time now for example, you can retrieve a list of MIDI events that occured within that frame. From there you can do something like animate objects based on the events.

## Stability
By default, `getEventsBetweenMilliseconds` and `getEventsBetweenTicks` are __not stable__. They will return the events between the specified start and end, however the events will not necessarily be in their original order.

For applications that only care about which events occured and not what order they occured in, this is fine. For example, a visual application that only cares about note on events on the current frame may not care what order those events are retrieved in.

For applications that __must preserve the order of events__ please initialize the `TimeResolver` with `{stable: true}` as the options argument. At a slight performance cost, this will guarantee events are returned in the same order they appeared in the original MIDI file. This is useful for accuracy-critial applications such as realtime MIDI playback.

Under the hood, this library uses `d3-binarytree` to very quickly find events between specified times. This is not stable. When passing `true` for the `stable` option, this library will keep an index of the events and use JavaScript's `sort` before returning events between specified times.