open-index/open-npm huggingface dataset:
npm package: @ponomarevlad/ya-disk-rest-api
Description: Тщательно типизированная и задокументированная обертка над Yandex Disk REST API
Author: Ilya Strus
Latest version: 1.1.2-fetch.4

# ya-disk-rest-api

Тщательно типизированная и задокументированная обертка над Yandex Disk REST API.

[Документация](https://s-r-x.github.io/ya-disk-rest-api)

## Использование
```sh
npm i ya-disk-rest-api
```
* * *
```typescript
import { YaDisk } from 'ya-disk-rest-api';

const disk = new YaDisk('oauth token');

await disk.upload({ path: 'file.txt', file: './local-file.txt' });
```
npm package: @ponsetya/browser
Description: Next-generation browser-based helpers.
Author: Aras Ekinci
Latest version: 1.1.0

They are the most frequently used and needed lightweight utility tools in browser-based projects.

You can use the media and library independently.

## Installation

For using the yarn package manager.

```shell
yarn add @ponsetya/browser
```

For using the npm.

```shell
npm install @ponsetya/browser
```

## Import

By default you can include all api and functions.

```ts
import browser from '@ponsetya/browser'
```

### Use APIs

```ts
import { cookie } '@ponsetya/browser'

cookie.set('name', 'John Doe')

console.log(cookie.get('name')) // John Doe
```

## License 

Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
npm package: @ponsetya/core
Description: Next-generation JavaScript helpers.
Author: Aras Ekinci
Latest version: 1.0.0

They are the most frequently used and needed lightweight utility tools in javascript-based projects.

You can use the media and library independently.

## Installation

For using the yarn package manager.

```shell
yarn add @ponsetya/core
```

For using the npm.

```shell
npm install @ponsetya/core
```

## Import

By default you can include all api and functions.

```ts
import ponsetya from '@ponsetya/core'
```

### Use APIs

```ts
import { Array } '@ponsetya/core'

const arr = ['x', 'y', 'z']

Array.remove(arr, 1) // ['x', 'z']
```

### Use helpers

```ts
import { classnames } '@ponsetya/core'

const className = classnames('foo', 'bar', {
  'foo-bar': false,
  'foo-bar--status': 'error',
})

console.log(className) // 'foo bar foo-bar--status-error'
```

## License 

Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
npm package: @ponsetya/javascript
Description: Next-generation JavaScript helpers.
Author: Aras Ekinci
Latest version: 1.1.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

They are the most frequently used and needed lightweight utility tools in javascript-based projects.

You can use the media and library independently.

## Installation

For using the yarn package manager.

```shell
yarn add @ponsetya/javascript
```

For using the npm.

```shell
npm install @ponsetya/javascript
```

## Import

By default you can include all api and functions.

```ts
import javascript from '@ponsetya/javascript'
```

### Use APIs

```ts
import { Array } '@ponsetya/javascript'

const arr = ['x', 'y', 'z']

Array.remove(arr, 1) // ['x', 'z']
```

### Use helpers

```ts
import { classnames } '@ponsetya/javascript'

const className = classnames('foo', 'bar', {
  'foo-bar': false,
  'foo-bar--status': 'error',
})

console.log(className) // 'foo bar foo-bar--status-error'
```

## License 

Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
npm package: @ponsetya/node
Description: Next-generation Node.js helpers.
Author: Aras Ekinci
Latest version: 1.1.0

They are the most frequently used and needed lightweight utility tools in node-based projects.

You can use the media and library independently.

## Installation

For using the yarn package manager.

```shell
yarn add @ponsetya/node
```

For using the npm.

```shell
npm install @ponsetya/node
```

## Import

By default you can include all api and functions.

```ts
import node from '@ponsetya/node'
```

### Use APIs

```ts
import { env } '@ponsetya/node'

env.node // true
env.browser // false
```

## License 

Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
npm package: @pontal/hubraft
Description: Election only raft like implementation designed for resilient overseers
Author: Guilherme Viebig
Latest version: 0.2.2

### Hubraft concepts
Hubraft is a NodeJs partial implementation of [The Raft Consensus Algorithm](https://raft.github.io), aiming to fullfil the needs of resilient applications that can't run in parallel.

![alt text](http://danehans.github.io/v3_presentation/images/etcd_raft_consensus.gif "Logo Title Text 1")

Hubraft does the election of nodes when the leader stop sending hearbeats, but **does not implements data replication**.

### Install
```javascript
npm install --save @pontal/hubraft
```
### Initializing

```javascript
const hubraft = require('@pontal/hubraft')(
    heartbeatInterval: 300, // optional
    minElectionTimeout: 800, // optional
    maxElectionTimeout: 1000, // optional
    name: 'master', // required
    host: 'master.example.com', // required
    port: 9899, // required
    nodes: [{ // required
        name: 'backup1',
        host: 'backup1.example.com',
        port: 9899,
    }, {
        name: 'backup2',
        host: 'backup2.example.com',
        port: 9899,
    }]
);
```

### Options
* `heartbeatInterval`: (optional) in milliseconds, defaults to 300ms
* `minElectionTimeout`: (optional) in milliseconds, defaults to 800ms
* `maxElectionTimeout`: (optional) in milliseconds, defaults to 1000ms
* `name`: (required) slug that identifies the application node
* `host`: (required) the hostname/ip which application is running
* `port`: (required) port which hubraft should listen  
* `nodes`: (required) other nodes of the application (array of name, host, port objects)  

### How it works

The Hubraft emits the following events :

- becomeLeader
- becomeFollower
- becomeCandidate

#### - becomeLeader

When the server is elected leader the event "becomeLeader" is sent to other servers, and to apply some type to behavior, use this script:

```javascript
const hubraft = require('@pontal/hubraft');

let options = {...};

const hub = hubraft.init(options);

hub.eventEmitter.on('becomeLeader', () => {
	// Start your application
}); 

```

#### - becomeFollower

The event "becomeFollower" is sent when another server is elected leader, this way the current server is left in "Stand by", and just keeps listening to the leader's heartbeat

```javascript
const hubraft = require('@pontal/hubraft');

let options = {...};

const hub = hubraft.init(options);

hub.eventEmitter.on('becomeFollower', () => {
	// Stop your system
});
```

#### - becomeCandidate

The event "becomeCandidate" is sent when the server was a "Follower" and the leader stops sending the heartbeat, and by default when a server becomes a "Candidate", he automatically asks for an election.

### Tests

["Jest"](http://facebook.github.io/jest/en/) needed.

```javascript
npm test
```