open-index/open-npm huggingface dataset:
npm package: @obsidize/api-guard-generator
Description: Experimental API guard generator for serial (non-parallel) method execution
Author: Josh Noel
Latest version: 0.0.1

# @obsidize/api-guard-generator

An experiment to test the feasibility of generating generic "Guard" classes for
APIs which require serial (non-parallel) method execution.

## Installation

- npm:

```bash
npm install --save @obsidize/api-guard-generator
```
npm package: @obsidize/command-queue
Description: Simple rxjs-based queueing mechanism to prevent call overlap of a target interface
Author: Josh Noel
Latest version: 1.1.0

# @obsidize/command-queue

A stupidly simple async queue.

Designed primarily to guard single-entry-point interfaces from being bombarded with calls from 
independent sources (e.g. multiple angular components hitting a single cordova API at once).

## Installation

- npm:

```bash
npm install --save @obsidize/command-queue
```

## Usage

```typescript
import {CommandQueue} from '@obsidize/command-queue';

const queue = new CommandQueue();
const result = await queue.add(() => doSomePromiseStuff());

const resultList = await Promise.all([1, 2, 3, 4, 5].map(v => {
	return queue.add(() => doSomePromiseStuffSerially(v));	
}));

// If the result is a deferred Observable
const observable = queue.observe(() => generatedDeferredObservable());
```

## API

Source documentation can be found [here](https://jospete.github.io/obsidize-command-queue/)
npm package: @obsidize/devkit
Description: Build tools for obsidize packages
Author: Josh Noel
Latest version: 1.0.5

# @obsidize/devkit

CLI utility to streamline building other obsidize modules

## Installation

- npm:

```bash
npm install --save-dev @obsidize/devkit
```

- tarball:

```bash
npm install --save-dev https://github.com/jospete/obsidize-devkit/raw/master/packed/obsidize-devkit.tgz
```

**NOTE:** you can also target a specific version in git by substituting "master" with any release branch "release/vX.Y.Z"

## Usage

After installation, run ```obsidize --help``` to see available cli commands
npm package: @obsidize/rotating-file-stream
Description: A rotating file stream based on the cordova File plugin API
Author: Josh Noel
Latest version: 1.2.3

# @obsidize/rotating-file-stream

Simple wrapper for streaming data to files on mobile devices in hybrid apps.

If you're using this for log capture on a cordova / capacitor app,
consider using [cordova-plugin-secure-logger](https://github.com/jospete/cordova-plugin-secure-logger) instead.

If you need a pure NodeJS implementation, use [rotating-file-stream](https://www.npmjs.com/package/rotating-file-stream) instead.

## Installation

- npm:

```bash
npm install --save @obsidize/rotating-file-stream
```

## API

Source documentation can be found [here](https://jospete.github.io/obsidize-rotating-file-stream/)

## Usage

1. Create A RotationFileStream instance:

```typescript
import { RotatingFileStream, CordovaFileEntryApi, CapacitorFileEntryApi } from '@obsidize/rotating-file-stream';

const fileStream = new RotatingFileStream({
	maxFileSize: 2e6, // 2MB
	files: CordovaFileEntryApi.createCacheRotationFiles(
		cdvFile, // @awesome-cordova-plugins/file reference
		'logs',
		['debug-a.log', 'debug-b.log']
	)
});

// Or if you want to use @capacitor/filesystem
const fileStream = new RotatingFileStream({
	maxFileSize: 2e6, // 2MB
	files: CapacitorFileEntryApi.createCacheRotationFiles(
		Filesystem, // @capacitor/filesystem reference
		'logs',
		['debug-a.log', 'debug-b.log']
	)
});
```

2. Write to the stream:

```typescript
const buffer = new ArrayBuffer(42);
fileStream.write(buffer).then(...);
```

3. Read data back later on:

```typescript
const entries = await fileStream.refreshAllEntries();

for (const entry of entries) {
	// read the entry data, or get its URL and do something with it
}
```
npm package: @obsidize/rx-socket
Description: Typescript socket implementation backed by rxjs streams
Author: Josh Noel
Latest version: 1.2.0

# @obsidize/rx-socket

An rxjs-based implementation of a standard duplex socket.

This implementation does not know (or care really) about the transport layer where the data ultimately ends up.
Rather, this allows for a compact and efficient way of linking send and receive streams in order to do the heavy lifting for "round-trip" protocols.

## Installation

- npm:

```bash
npm install --save @obsidize/rx-socket
```

- git:

```bash
npm install --save git+https://github.com/jospete/obsidize-rx-socket.git
```

## Usage

### Example

The below example uses a socket instance for both the client and the server.

However, when using this in your app you should only use this module as either the client or the server, 
but **not** both (unless you like talking to yourself).

```typescript
import { RxJsonSocket } from '@obsidize/rx-socket';
import { delay, first, tap } from 'rxjs/operators';

const sendMessage = { message: 'hello' };
const receiveMessage = { message: 'world!' };

const client = new RxJsonSocket();
const server = new RxJsonSocket();

client.setBufferReceiveSource(server.bufferStream.onSend.pipe(
	delay(10),
));

server.setBufferReceiveSource(client.bufferStream.onSend.pipe(
	delay(10),
	tap(() => server.emit(receiveMessage))
));

client.textStream.onSend.subscribe(v => console.log('client textStream.onSend: ' + v));
client.textStream.onReceive.subscribe(v => console.log('client textStream.onReceive: ' + v));

server.textStream.onSend.subscribe(v => console.log('server textStream.onSend: ' + v));
server.textStream.onReceive.subscribe(v => console.log('server textStream.onReceive: ' + v));

// The client and server sockets are "glued together" in such a way that we can
// send a message and wait for a response all in one go - much like an HTTP or websocket request.
const serverResponse = await client.send(sendMessage)
	.pipe(first())
	.toPromise();

console.log(serverResponse); // { message: 'world!' }
```

See the [General Usage](https://github.com/jospete/obsidize-rx-socket/blob/master/tests/general-usage.spec.ts)
and [RxSocketSubject](https://github.com/jospete/obsidize-rx-socket/blob/master/tests/rx-socket-subject.spec.ts)
test suites to get a feel for how to use this module.

## API

Source documentation can be found [here](https://jospete.github.io/obsidize-rx-socket/)
npm package: @obsidize/semver
Description: Middleware to compare semver strings and not cause error explosions on malformed input
Author: Josh Noel
Latest version: 1.1.0

# @obsidize/semver

Middleware to compare semver strings and not cause error explosions on malformed input.

This was created with the belief that a version comparator should not halt execution during other complex processes.

```typescript
import * as compareVersions from 'compare-versions';
import {Semver} from '@obsidize/semver';

compareVersions('1.2.3', ''); // ERROR ERROR ERROR ONE OF THE ARGS ISN'T A VERSION AHHHHH!!!
Semver.greaterThan('1.2.3', ''); // false
```

**NOTE:** While the above example is poking fun at the [compare-versions](https://www.npmjs.com/package/compare-versions)
module, this module actually uses compare-versions as the primary backend for core comparison logic.

## Installation

- npm:

```bash
npm install --save @obsidize/semver
```

- git:

```bash
npm install --save git+https://github.com/jospete/obsidize-semver.git
```

## Usage

### Example

```typescript
import {Semver, SemverComparator, SemverContext} from '@obsidize/semver';

// Use the static comparator for one-off comparisons
console.log(Semver.gt('1.2.3', '1')); // true
console.log(Semver.gt('1.2.3', null)); // false
console.log(Semver.eq('1.2.3', null, true)); // true (because 3rd parameter 'defaultValue' is true)

// Or create a version context for multiple checks against a target version
const version = new SemverContext(() => '1.2.3'); // or load this dynamically from somewhere else
console.log(version.lt('2')); // true
console.log(version.eq('1.2.3')); // true
console.log(version.gte('1.2.3')); // true
console.log(version.gt(null)); // false
console.log(version.gt(null, true)); // true
console.log(version.gt('2', true)); // false

// Don't like 'compare-versions' as the backend?
// Make your own!
const customComparator = new SemverComparator((a, b) =>  /* fancy compare function here */);
```

See the [Example Usage Spec](https://github.com/jospete/obsidize-semver/blob/master/tests/example-usage.spec.ts) to get a general feel for what this module can do.

## API

Source documentation can be found [here](https://jospete.github.io/obsidize-semver/)
npm package: @obsidize/storage-context
Description: Utilities to enhance and organize complex sets of data on top of simple key/value systems like localStorage.
Author: Josh Noel
Latest version: 1.4.0

# @obsidize/storage-context

Utilities to enhance and organize complex sets of data on top of simple key/value systems like localStorage.

The primary goals of this module are:

- to eliminate "loose strings" that tend to accompany complex storage mechanisms
- to flatten complex data sets into atomic key/value pairs that can be persisted on any synchronous / asynchronous / local / remote transport layers.

The benefits of this module really kick in for large, complex datasets that may need to persist across multiple transports.

If you just need to save 3 string values to localStorage, you probably don't need this module.

## Installation

- npm:

```bash
npm install --save @obsidize/storage-context
```

- git:

```bash
npm install --save git+https://github.com/jospete/obsidize-storage-context.git
```

## Usage

### Example

```typescript
import { BrowserStorageTransport, StorageContext } from '@obsidize/storage-context';

const browserTransport = new BrowserStorageTransport(localStorage);
const baseContext = new StorageContext(browserTransport);
const context = baseContext.getSubContext('namespace_for_your_feature');

const userEmail = context.getKeyValuePair('userEmail');
console.log(userEmail.absoluteKey); // 'namespace_for_your_feature$userEmail';

const userId = context.createEntity<number>('userId');
console.log(userId.keyValuePair.absoluteKey); // 'namespace_for_your_feature$userId';

const emailValue = await userEmail.load('Does Not Exist');
console.log(emailValue); // 'Does Not Exist'

await userEmail.save('test@test.org');
const emailValue2 = await userEmail.load('Does Not Exist');
console.log(emailValue2); // 'test@test.org'

const userIdValue = await userId.load(-1);
console.log(userIdValue); // -1

await userId.save(42);
const userIdValue2 = await userId.load(-1);
console.log(userIdValue2); // 42
console.log(typeof userIdValue2); // 'number'
```

See the [Example Usage Spec](https://github.com/jospete/obsidize-storage-context/blob/master/tests/example-usage.spec.ts) to get a general feel for what this module can do.

See the [Native Proxy Spec](https://github.com/jospete/obsidize-storage-context/blob/master/tests/example-native-storage-proxy.spec.ts) for an example of hot-swapping transports.

## API

Source documentation can be found [here](https://jospete.github.io/obsidize-storage-context/)
npm package: @obsk/react-eos
Description: React components for JSROOT
Author: Martin Vala
Latest version: 0.2.6

# react-eos

## Create app using CRA

Info: https://github.com/facebookincubator/create-react-app

## Install package

Install ```@obsk/react-eos```
```
npm install --save @obsk/react-eos
```
or
```
yarn add @obsk/react-eos
```

# Note
Project was generated via https://github.com/UdiliaInc/create-react-library
npm package: @obsk/react-eos-md
Description: React components for EOS
Author: Martin Vala
Latest version: 0.2.8

# react-eos-md

## Install pacakge

Install ```@obsk/react-eos-md```
```
npm install --save @obsk/react-eos-md
```
or
```
yarn add @obsk/react-eos-md
```

> You will also need `react-eos` package

## Example component can be added to the app like this

```
import React, { Component, Fragment } from 'react';
import { browserWithData } from '@obsk/react-eos';
import { EosBrowserMd } from '@obsk/react-eos-md';

const EosBrowserComponent = browserWithData(EosBrowserMd, file => handleFileClick(file));

const handleFileClick = file => {
  console.log(`Handling file with path ${file.path}`);
}

class App extends Component {

  render() {
    return (
      <Fragment>
        <EosBrowserComponent />
      </Fragment>
    );
  }
};

export default App;
```

# Note
Project was generated via https://github.com/UdiliaInc/create-react-library
npm package: @obsk/react-jsroot
Description: React components for JSROOT
Author: Martin Vala
Latest version: 0.3.1

# react-jsroot

## Create app using CRA

Info: https://github.com/facebookincubator/create-react-app

## Install pacakge

Install ```@obsk/react-jsroot```
```
npm install --save @obsk/react-jsroot
```
or
```
yarn add @obsk/react-jsroot
```

## Example for your project
> Note that example is located at `src/demo/App.js`

Example component can be added to the app like this

```
[mvala@vala myapp]$ cat src/demo/App.js 
import React from 'react';
import JSRootExample from '../lib/components/JSRootExample';
import JSRootBrowser from '../lib/components/JSRootBrowser';

const App = () => (
  <div>
    <JSRootExample name='hist1' />
    <JSRootBrowser 
      name='MyBrows'
      filename="https://alieos.saske.sk//eos/alike.saske.sk/scratch/hsimple.root" 
      obj="hpxpy;1" 
      drawOptions="colz" 
      displayType="simple" 
      onScriptLoaded={this.onScriptLoaded}
      tree={{width: "250px", height: "500px", float: "left"}} 
      main={{width: "500px", height: "500px"}} 
    />
  </div>
);

export default App;
```

# Note
Project was generated via https://github.com/UdiliaInc/create-react-library