open-index/open-npm huggingface dataset:
npm package: @robinthomas/erasure-sdk
Description: Erasure SDK
Author: Robin Thomas
Latest version: 1.0.22

# Erasure SDK

![](https://img.shields.io/badge/nodejs-12.04-blue.svg)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)

# Table of Contents

1. [Introduction](#introduction)
2. [Features](#features)
3. [Tests](#tests)

# Introduction

**Erasure SDK** is an SDK for Erasure writen in JS.

SDK documentation can be found here: https://erasure-docs.robinthomas2591.now.sh/

SDK can be installed by,

```sh
$ npm install @robinthomas/erasure-sdk
```

# Features

- Supports Erasure version - v1.3.0
- Supports Erasure Feeds, Posts, Escrows and Agreements
- Keyvault for client side encryption and transaction signing (using 3Box)
- Datastore for storing feed, post and other details (using 3Box)
- Ability to pass a web3Provider (optional)
- Simplifies SDK for users using classes & objects.
- ErasureFeed
  - add a post while creating a new feed (optional)
  - create a new post
  - retrieve all the posts in a feed
  - reveal all the posts in a feed
  - check if the posts have been revealed or not
- ErasurePost
  - offer to sell a post
  - find the number of sell offers for a post
  - offer to buy a post
  - find the number of buy offers for a post
  - reveal a post
  - get the total number of times a post has been sold
- ErasureEscrow
  - deposit stake by seller (if the payment is already deposited by buyer, encrypted sym key will be added to escrow)
  - deposit payment into the escrow by the buyer
  - finalize the escrow (and add the encrypted sym key to the escrow)
  - cancel an escrow
- Escrow Agreement
  - stake some amount into an agreement (called by operator)
  - reward the staker (called by counterparty)
  - punish, i.e. burn some stake (called by counterparty)
  - release some stake (called by counterparty)
  - request some withdraw (called by staker to start the countdown to withdraw some stake)
  - withdraw some stake to a recipient (called by staker)
  - check the agreement status
- Given a address/proofhash, detect if its an ErasureFeed, Post, Agreement or Escrow and return the correct object

# Tests

Tests are written using _mocha_ and are executed with the help of _truffle_. Test coverage is using _nyc_.

These tests are run in a test _ganache_ network, which deploys all the Erasure smart contracts v1.2.0 and then runs through all the contract tests.

```sh
npm run test
npm run coverage
```
npm package: @robinthomas/react-erasure
Description: React components for Erasure
Author: Robin Thomas
Latest version: 1.0.6

# React Erasure
![](https://img.shields.io/badge/React-v16.12-red)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)

# Table of Contents
1. [Introduction](#introduction)
2. [Features](#features)
3. [Components](#components)

# Introduction
**React Erasure** is react components library that helps to quickly bootstrap a dapp on Erasure, by accelerating dapp development by abstracting away the complexity.

Libary can be installed by,
```sh
$ npm install @robinthomas/react-erasure
```

# Features
- Supports Erasure protocol version v1.1.0
- Supports Ethereum mainnet and Rinkeby networks
- Provides various React components
    - Login
    - Feed
    - Post
    - Reveal Post
    - Stake
    - Punish
    - Reward
    - Release Stake
    - Retrieve Stake

# Components

##### Login
- To setup the Metamask provider and permissions

##### Feed
- create a new feed

##### Post
- create a new post
- select one of the feeds detected in this account, to which the post can be added
- progress bar for uploading raw data

##### Reveal Post
- select a feed
- select a post under that feed and then reveal it

##### Stake
- create a new countdown griefing agreement

##### Punish
- select one of the griefing auto-detected
- punish the staker (in NMR)
- add a punishment message

##### Reward
- select one of the griefing auto-detected
- reward the staker (in NMR)

##### Release Stake
- select one of the griefing auto-detected 
- release some stake to the staker (in NMR)

##### Retrieve Stake
- select one of the griefing auto-detected 
- release some stake to the staker (in NMR)
npm package: @robinvdbroeck/openlayers-devtools
Description: Devtools to use with OpenLayers
Latest version: 0.1.0

# Openlayers-devtools

## Usage:

```javascript
// Using es6 modules
import Map from "ol/Map";
import OlDevtools from "@robinvdbroeck/openlayers-devtools";
// or commonjs
const Map = require("ol/map");
const OlDevtools = require("@robinvdbroeck/openlayers-devtools");

const myOlMap = new Map(...);

const devtools = new OlDevtools({
    map: myOlMap,
    target: "id" // ID of an empty dom element, preferably a div
});
```

## Requirements

Any openlayers version more recent than 7.0.0 should work.

Previous versions might also work, but are not tested.
npm package: @robireton/circle
Description: ES6 module for working with angles in circles
Author: Rob Ireton
Latest version: 1.2.1

# circle

[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![current version](https://img.shields.io/npm/v/@robireton/circle)](https://www.npmjs.com/package/@robireton/circle)
[![install size](https://packagephobia.com/badge?p=@robireton/circle)](https://packagephobia.com/result?p=@robireton/circle)


ES6 module for working with angles in circles

## usage
```js
import circle from '@robireton/circle'

circle.DegreesToRadians(90)
```

## methods

### DegreesToRadians( `number` )

#### arguments
`number`: an angle expressed in degrees

#### returns
`number`: an angle expressed in radians

#### example
```js
circle.DegreesToRadians(90)
// => 1.5707963267948966
```


### RadiansToDegrees( `number` )

#### arguments
`number`: an angle expressed in radians

#### returns
`number`: an angle expressed in degrees

#### example
```js
circle.RadiansToDegrees(Math.PI)
// => 180
```


### normalizedDegrees( `number` )

#### arguments
`number`: an angle expressed in degrees

#### returns
`number`: an angle expressed in degrees in the interval [0, 360)

#### example
```js
circle.normalizedDegrees(1122)
// => 42
```


### normalizedRadians( `number` )

#### arguments
`number`: an angle expressed in radians

#### returns
`number`: an angle expressed in radians in the interval [0, 2π)

#### example
```js
circle.normalizedRadians(-12.3)
// => 0.26637061435917175
```


### DDtoDMS( `number` )
decimal degrees to degrees, minutes, and seconds

#### arguments
`number`: an angle expressed in degrees

#### returns
`string`: an angle formatted as _d° m′ sʺ_ (that space is a narrow no-break space, U+202F)

#### example
```js
circle.DDtoDMS(42.1024)
// => '42° 6′ 8ʺ'
```
npm package: @robireton/delta-t
Description: ES6 module to compute estimates of ΔT — the difference between local/civil time and uniform/dynamical time
Author: Rob Ireton
Latest version: 1.1.0

# delta-t

[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![current version](https://img.shields.io/npm/v/@robireton/delta-t)](https://www.npmjs.com/package/@robireton/delta-t)
[![install size](https://packagephobia.com/badge?p=@robireton/delta-t)](https://packagephobia.com/result?p=@robireton/delta-t)

ES6 module to compute estimates of [ΔT](https://en.wikipedia.org/wiki/%CE%94T) — the difference between local/civil time and uniform/dynamical time — using algorithms from [NASA - Polynomial Expressions for Delta T](https://eclipse.gsfc.nasa.gov/SEhelp/deltatpoly2004.html). Also see Chapter 9, “Dynamical Time and Universal Time,” of [_Astronomical Algorithms_ by Jean Meeus](https://www.willbell.com/math/MC1.HTM).

## Syntax

### computeΔT( _year_, _month_ )

#### parameters
`year`: the year as a number

`month`: the number of the month (January = 1, February = 2, etc.)

#### returns
value of ΔT in seconds

#### example
```js
import computeΔT from '@robireton/delta-t'

computeΔT(1971, 10)
// => 42
```
npm package: @robireton/etag
Description: Create simple HTTP ETags
Author: Rob Ireton
Latest version: 2.0.0

# etag

Create simple HTTP ETags

This module generates HTTP ETags (as defined in RFC 7232) for use in
HTTP responses.

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```shell
$ npm install @robireton/etag
```

## API

```js
import etag from '@robireton/etag'
```

### etag(entity, [options])

Generate a strong ETag for the given entity. This should be the complete
body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By
default, a strong ETag is generated except for `fs.Stats`, which will
generate a weak ETag (this can be overwritten by `options.weak`).

```js
res.setHeader('ETag', etag(body))
```

#### Options

`etag` accepts these properties in the options object.

##### weak

Specifies if the generated ETag will include the weak validator mark (that
is, the leading `W/`). The actual entity tag is the same. The default value
is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`.

## License

[MIT](LICENSE)
npm package: @robireton/fresh
Description: HTTP response freshness testing
Author: Rob Ireton
Latest version: 1.0.0

# fresh

HTTP response freshness testing

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```shell
$ npm install @robireton/fresh
```

## API

```js
import fresh from '@robireton/fresh'
```

### fresh(reqHeaders, resHeaders)

Check freshness of the response using request and response headers.

When the response is still “fresh” in the client’s cache `true` is
returned, otherwise `false` is returned to indicate that the client
cache is now stale and the full response should be sent.

When a client sends the `Cache-Control: no-cache` request header to
indicate an end-to-end reload request, this module will return `false`
to make handling these requests transparent.

## Known Issues

This module is designed to only follow the HTTP specifications, not
to work-around all kinda of client bugs (especially since this module
typically does not receive enough information to understand what the
client actually is).

There is a known issue that in certain versions of Safari, Safari
will incorrectly make a request that allows this module to validate
freshness of the resource even when Safari does not have a
representation of the resource in the cache. The module
[jumanji](https://www.npmjs.com/package/jumanji) can be used in
an Express application to work-around this issue and also provides
links to further reading on this Safari bug.

## Example

### API usage

```js
const reqHeaders = { 'if-none-match': '"foo"' }
const resHeaders = { 'etag': '"bar"' }
fresh(reqHeaders, resHeaders)
// => false

const reqHeaders = { 'if-none-match': '"foo"' }
const resHeaders = { 'etag': '"foo"' }
fresh(reqHeaders, resHeaders)
// => true
```

### Using with Node.js http server

```js
import fresh from '@robireton/fresh'
import http from 'node:http'

const server = http.createServer((req, res) => {
  // perform server logic
  // ... including adding ETag / Last-Modified response headers

  if (isFresh(req, res)) {
    // client has a fresh copy of resource
    res.statusCode = 304
    res.end()
    return
  }

  // send the resource
  res.statusCode = 200
  res.end('hello, world!')
})

function isFresh (req, res) {
  return fresh(req.headers, {
    'etag': res.getHeader('ETag'),
    'last-modified': res.getHeader('Last-Modified')
  })
}

server.listen(3000)
```

## License

[MIT](LICENSE)
npm package: @robireton/meeus
Description: ES6 implementations of algorithms from Astronomical Algorithms by Jean Meeus
Author: Rob Ireton
Latest version: 1.1.0

# meeus

[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![current version](https://img.shields.io/npm/v/@robireton/meeus)](https://www.npmjs.com/package/@robireton/meeus)
[![install size](https://packagephobia.com/badge?p=@robireton/meeus)](https://packagephobia.com/result?p=@robireton/meeus)

ES6 implementations of algorithms from Astronomical Algorithms by Jean Meeus
npm package: @robireton/serve-favicon
Description: favicon serving middleware with caching
Author: Rob Ireton
Latest version: 3.0.1

# serve-favicon

*Node.js middleware for serving a favicon*

this scoped version forked from [expressjs/serve-favicon](https://github.com/expressjs/serve-favicon) to:
  - rewrite as an ECMAScript Module
  - remove dependencies

A favicon is a visual cue that client software, like browsers, use to identify
a site. For an example and more information, please visit
[the Wikipedia article on favicons](https://en.wikipedia.org/wiki/Favicon).

Why use this module?

  - User agents request `favicon.ico` frequently and indiscriminately, so you
    may wish to exclude these requests from your logs by using this middleware
    before your logger middleware.
  - This module caches the icon in memory to improve performance by skipping
    disk access.
  - This module provides an `ETag` based on the contents of the icon, rather
    than file system properties.
  - This module will serve with the most compatible `Content-Type`.

**Note** This module is exclusively for serving the “default, implicit favicon”,
which is `GET /favicon.ico`. For additional vendor-specific icons that require
HTML markup, additional middleware is required to serve the relevant files, for
example [serve-static](https://npmjs.org/package/serve-static).

## Install

This is an ECMAScript Module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```shell
$ npm install @robireton/serve-favicon
```

## API

### favicon(path, options)

Create new middleware to serve a favicon from the given `path` to a favicon file.
`path` may also be a `Buffer` of the icon to serve.

#### Options

Serve favicon accepts these properties in the options object.

##### maxAge

The `cache-control` `max-age` directive in `ms`, defaulting to 1 year.

## Example

Typically this middleware will come very early in your stack (maybe even first)
to avoid processing any other middleware if we already know the request is for
`/favicon.ico`.

### express

```javascript
import { resolve } from 'node:path'
import express from 'express'
import favicon from '@robireton/serve-favicon'

const app = express()
app.use(favicon(resolve('static/favicon.ico')))

// Add your routes here, etc.

app.listen(3000)
```

## License

[MIT](LICENSE)
npm package: @robit-dev/tailwindcss-class-combiner
Description: A simple utility for combining and overriding class names in React components, with additional functionality for tailwindcss users.
Author: Robit Development
Latest version: 1.0.2

# What is this?

`tailwindcss-class-combiner` is a simple utility for combining and overriding class names
in React components. On top of that, it also allows you to override existing Tailwind
CSS classes in the component.

# Installation

This utility can be installed using npm:
`npm i @robit-dev/tailwindcss-class-combiner --save`

# Usage

For any component that you want to be able to override default classes on, import `mergeClasses`
from the package. Next, modify the component to accept a prop for the new classes. 
Then add a `const` in your return method that will contain the default classes
for the element in the markup that you want to be overridable. Finally, set that element's
class name like so `className={ mergeClasses(defaultClasses, className) }`.

Here's a simple `Card` component that uses the utility:

```javascript
import mergeClasses from "@robit-dev/tailwindcss-class-combiner"

const Card = ({ children, className }) => {
    const defaultClasses = 'rounded-xl p-4 bg-white'
    return (
        <div className={ mergeClasses(defaultClasses, className) }>
            { children }
        </div>
    )
}

export default Card
```

Then, when using the component elsewhere, we'll simply provide some new classes via the `className` 
prop.

```html
<Card className="m-4 p-8">
    This is a Card component with added and overridden classes!
</Card>
```

The resulting classes would then be:

```html
<Card class="rounded-xl p-8 bg-white m-4"></Card>
```

Notice how the new class `m-4` was added to the class list, while the `p-4` tailwindcss class 
of the original component is now replaced with the matching tailwind class type we passed in,
`p-8`.

# How does this work with tailwindcss?

This utility splits class names on the hyphens, in order to be able to accurately replace 
existing tailwindcss class names. For instance, there are many class names that control
padding in css (`p-2`, `p-4`, `p-8`, etc) but they all start with `p-`. Because of this
we can override default tailwindcss classes in a component by matching and then replacing
based on the class prefix. This method also preserves screen size, and state directives
like `lg:` or `hover:` because it only splits and replaces on exact matches preceeding a 
hyphen.

## License
This code is released under the MIT License.

## Stack
<b>Built with</b> [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)

MIT © [Robit Development, LLC](https://robit.dev)
npm package: @robixxu/range
Description: Javascript version of Python range
Author: Schiriac Robert
Latest version: 0.0.7

# range
Javascript version of Python range

### Install
```
npm install @robixxu/range
```

##### Add to your project
```
const range = require('@robixxu/range');
```

```
import range from '@robixxu/range';
```
### Usage
```
range(stop)
range(start, stop, [step])
```

### Examples
```
range(5)      // [0,1,2,3,4]
```

```
range(1,5)    // [1,2,3,4]
```

```
range(0)      // []
```

```
range(-5,0)   // [-5, -4, -3, -2, -1]
```

```
range(1,5,2)  // [1,3]
```

### Support
If you find any problems feel free to tweet @robiXxu, email at schiriac.robert@gmail.com or [open a issue](https://github.com/robiXxu/range/issues/new) on Github.

### [MIT License](LICENSE)
npm package: @robjtede/cache-conf
Description: Simple cache config handling for your app or module
Author: Sam Verschueren
Latest version: 0.6.2

# cache-conf [![Build Status](https://travis-ci.org/SamVerschueren/cache-conf.svg?branch=master)](https://travis-ci.org/SamVerschueren/cache-conf)

> Simple cache config handling for your app or module

If you don't need caching, you should use [conf](https://github.com/sindresorhus/conf) instead. This module extends that module and abstracts away the caching mechanism.


## Install

```
$ npm install --save cache-conf
```


## Usage

```js
const delay = require('delay');
const CacheConf = require('cache-conf');
const config = new CacheConf();

config.set('unicorn', '🦄', {maxAge: 5000});
console.log(config.get('unicorn'));
//=> '🦄'

// Wait 5 seconds
await delay(5000);

console.log(config.get('unicorn'));
//=> undefined
```


## API

### CacheConf([options])

Returns a new instance.

#### options

Any of the [conf options](https://github.com/sindresorhus/conf#options).

### Instance

An extended [conf](https://github.com/sindresorhus/conf#instance) instance.

#### get(key, [options])

Get an item.

##### options

###### ignoreMaxAge

Type: `boolean`<br>
Default: `false`

Get the item for the `key` provided without taking the `maxAge` of the item into account.

#### set(key, value, [options])

Set an item.

#### set(object, [options])

Set multiple items at once.

##### options

###### maxAge

Type: `number`

Number of milliseconds the cached value is valid.

###### version

Type: `string`

Version number of the data. If the version provided is not the same as the version of the cached data, the data will be invalid.

#### isExpired(key)

Boolean indicating if the cached data is expired.


## Related

- [conf](https://github.com/sindresorhus/conf) - Simple config handling for your app or module
- [observable-conf](https://github.com/SamVerschueren/observable-conf) - Listen for changes in your conf config


## License

MIT © [Sam Verschueren](https://github.com/SamVerschueren)
npm package: @roblabla/connect-sse
Description: connect middleware for server sent events (EventSource)
Author: Andrew Kelley
Latest version: 1.3.0

[![Build Status](https://secure.travis-ci.org/andrewrk/connect-sse.png)](http://travis-ci.org/andrewrk/connect-sse)

Usage:
------

```js
var sse = require('connect-sse')();
var express = require('express')

var app = express()
app.get('/events', sse, function (req, res) {
  res.json("this is an event");
  res.json({here: "is", another: "event"});
  res.json({here: "is a named event", to: "listen with addEventListener('example', function(){})"}, "example");
});
```
npm package: @roblabla/protodef
Description: A simple yet powerful way to define binary protocols
Author: roblabla
Latest version: 1.2.2

# ProtoDef
[![NPM version](https://img.shields.io/npm/v/protodef.svg)](http://npmjs.com/package/protodef)
[![Join the chat at https://gitter.im/roblabla/ProtoDef](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/roblabla/ProtoDef?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://img.shields.io/circleci/project/roblabla/ProtoDef/master.svg)](https://circleci.com/gh/roblabla/ProtoDef)
[![Tonic](https://img.shields.io/badge/tonic-try%20it-blue.svg)](https://tonicdev.com/npm/protodef)

This is a node.js module to simplify defining, reading and writing binary blobs,
whether they be internet protocols or files.

## Installing

```
npm install ProtoDef
```


## Usage

See [example](example.js)

## Documentation

See the language independent [ProtoDef](https://github.com/ProtoDef-io/ProtoDef) specification.

* [api.md](doc/api.md) documents the exposed functions and classes
* [datatypes.md](https://github.com/ProtoDef-io/ProtoDef/blob/master/doc/datatypes.md) documents the default datatypes provided by Protodef.
* [newDatatypes.md](doc/newDatatypes.md) explains how to create new datatypes for protodef
* [history.md](doc/history.md) is the releases history

## Projects Using ProtoDef

* [minecraft-protocol](https://github.com/PrismarineJS/node-minecraft-protocol) defines a protocol.json by minecraft version and use ProtoDef to serialize and parse packets
  * the protocol.json files are stored in [minecraft-data](https://github.com/PrismarineJS/minecraft-data/blob/master/data/1.8/protocol.json)
  * and they can be visualized automatically in this [doc](http://prismarinejs.github.io/minecraft-data/?d=protocol)
* [prismarine-nbt](https://github.com/PrismarineJS/prismarine-nbt) defined a nbt.json to parse and serialize the NBT format
* [mineflayer](https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/command_block.js) uses ProtoDef to parse plugin messages
* [minecraft-protocol-forge](https://github.com/PrismarineJS/node-minecraft-protocol-forge) parses and serialize forge plugin messages
* [node-raknet](https://github.com/mhsjlw/node-raknet) describe the raknet protocol in a protocol.json and uses ProtoDef to read it
* [minecraft-classic-protocol](https://github.com/mhsjlw/minecraft-classic-protocol) defines the classic minecraft protocol with ProtoDef
* [pocket-minecraft-protocol](https://github.com/mhsjlw/pocket-minecraft-protocol) defines the minecraft pocket edition protocol