open-index/open-npm huggingface dataset:
npm package: @stopsopa/dotenv-up
Description: dotenv but it also search through parent directories
Author: Szymon Dzialowski
Latest version: 1.0.30

[![npm version](https://badge.fury.io/js/dotenv-up.svg)](https://badge.fury.io/js/dotenv-up)
[![NpmLicense](https://img.shields.io/npm/l/dotenv-up.svg)](https://github.com/stopsopa/dotenv-up/blob/master/LICENSE)

# Installation

```bash
    yarn add dotenv-up
```    

# Reference

```javascript
    require('dotenv-up')(3, true, 'sandbox/server.js');
    
    /**
     * Use like
     *     require('dotenv-up')(2); // 2 - default assigned to 'deep' parameter
     *     require('dotenv-up')(2, false); // second param is "debug" flag - to show on not show each step on the screen
     *     require('dotenv-up')(2, false, 'name of load'); // plain text to describe individual use of this library
     *     require('dotenv-up')({
                path            = process.cwd(),
                envfile         = '.env',
                override        = true, // override values in process.env
                deep            = 1,
                startfromlevel  = 0,
                justreturn      = false, // don't add found values to the process.env global object
                ... other dotenv options https://www.npmjs.com/package/dotenv
     *     });
     *
     * @param opt
     * @param debug (def: true)
     * @param name
     * @returns {} - object with all extracted variables
     */
```

# Docker use

```javascript

require('dotenv-up')({
    override    : false, // don't override existing parameters in process.env by those from .env file
    deep        : 3,
}, true, 'sandbox/server.js');

// instead of:

require('dotenv-up')(3, true, 'sandbox/server.js');
// because 'override' flag is by default true

```

# Todo

- [ ] Early detection of spaces around "=" https://imgur.com/a/wWml96T 

# Tip

If you need to include other file that use internally again dotenv-up tool in override mode but you don't want those changes of process.env affect proce.env in you'r scope, do:

    const ttt = {...process.env};
    require('./lib/lib.js') // with its own require('dotenv-up')(1);
    process.env = ttt;
npm package: @stopsopa/ipromise
Description: [![Build Status](https://travis-ci.org/stopsopa/ipromise.svg?branch=v0.0.16)](https://travis-ci.org/stopsopa/ipromise) [![npm version](https://badge.fury.io/js/%40stopsopa%2Fipromise.svg)](https://badge.fury.io/js/%40stopsopa%2Fipromise) [![NpmLicense](ht
Latest version: 0.0.16

[![Build Status](https://travis-ci.org/stopsopa/ipromise.svg?branch=v0.0.16)](https://travis-ci.org/stopsopa/ipromise)
[![npm version](https://badge.fury.io/js/%40stopsopa%2Fipromise.svg)](https://badge.fury.io/js/%40stopsopa%2Fipromise)
[![NpmLicense](https://img.shields.io/npm/l/@stopsopa/ipromise.svg)](https://github.com/stopsopa/ipromise/blob/master/LICENSE)


<a href="http://promisesaplus.com/">
    <img src="http://promisesaplus.com/assets/logo-small.png" alt="Promises/A+ logo"
         title="Promises/A+ 1.0 compliant" align="right"/>
</a>

<dl><dt>&nbsp;</dt><dd>&nbsp;</dd></dl>

## Table of Contents

<!-- toc -->

- [Thanks](#thanks)
- [License](#license)

<!-- tocstop -->

<h1>ipromise.js </h1>

Standalone, lightweight and multiplatform javascript implementatnion of 
[Promises/A+](http://promises-aplus.github.com/promises-spec) design pattern (ready to use in browser and in node.js)


***

## Thanks

Thanks for e-mail consultations

- [briancavalier](https://github.com/briancavalier)
- [kevinconway](https://github.com/kevinconway)


## License

The MIT License (MIT)
Copyright (c) 2014 Szymon Działowski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
npm package: @stopsopa/knex-abstract
Description: [![Build Status](https://travis-ci.org/stopsopa/knex-abstract.svg?branch=v0.0.55)](https://travis-ci.org/stopsopa/knex-abstract) [![npm version](https://badge.fury.io/js/%40stopsopa%2Fknex-abstract.svg)](https://badge.fury.io/js/%40stopsopa%2Fknex-abstrac
Author: Szymon Działowski
Latest version: 0.0.55

[![Build Status](https://travis-ci.org/stopsopa/knex-abstract.svg?branch=v0.0.55)](https://travis-ci.org/stopsopa/knex-abstract)
[![npm version](https://badge.fury.io/js/%40stopsopa%2Fknex-abstract.svg)](https://badge.fury.io/js/%40stopsopa%2Fknex-abstract)
[![codecov](https://codecov.io/gh/stopsopa/knex-abstract/branch/v0.0.55/graph/badge.svg)](https://codecov.io/gh/stopsopa/knex-abstract/tree/v0.0.55)
[![NpmLicense](https://img.shields.io/npm/l/@stopsopa/knex-abstract.svg)](https://github.com/stopsopa/knex-abstract/blob/master/LICENSE)

# Installation:

    npx @stopsopa/knex-abstract
    cd knex-project
    cat test.js
    # and see Makefile
    
# usege: 

    require('@stopsopa/dotenv-up')(4, false, '.env');
    
    const knex              = require('@stopsopa/knex-abstract');
    
    const config      = require('config');
    
    knex.init(config);
    
    (async function(){
    
        const list = await knex().model.common.raw('show tables');
        
        // ...
    
        knex().destroy();
    })();
    
# examples:
    
- [transactions](migrations/src/migration/1545125154513-auto.ts)

See example of [config](models/config.js)

Follow:

 - [test cases](https://github.com/stopsopa/knex-abstract/blob/master/test/knex/mysql/mysql-insert.test.js)
 - [test script](https://github.com/stopsopa/knex-abstract/blob/master/example/test.js)
npm package: @stopsopa/line
Description: Lib to draw lines using one div and css
Author: Szymon Dzialowski
Latest version: 2.0.0

# jQuery.line plugin

***

> jQuery plugin to draw lines using single DIV and pure CSS3

***


## Demo:

[Demo](http://stopsopa.bitbucket.org/demos/jquery.line/demo.html)



### Using:

```js
var linediv =                   $.line(x1, y1, x2, y2, opt, callback);
var linediv = $('parent element').line(x1, y1, x2, y2, opt, callback);
```

or

radians and distance
```js
var linediv =                   $.line(x1, y1, {rad: Math.PI/4, dis: 200}, opt, callback);
var linediv = $('parent element').line(x1, y1, {rad: Math.PI/4, dis: 200}, opt, callback);
```
or


angle and distance
```js
var linediv =                   $.line(x1, y1, {ang: 45, dis: 200}, opt, callback);
var linediv = $('parent element').line(x1, y1, {ang: 45, dis: 200}, opt, callback);
```


### Default options are:


```js
{
    create: $('<div></div>'), // default it's div, you can change to $('<span></span>')
    cls: '_line', 
    id : false,
    css: {  
        // you can change styles of div in js here through $(..).css()
        // but be careful that you can override here property used
        // to calculations ('width') 
        // which is defined right below        
        height: '0',
        zIndex: '999',
        zoom: 1
    },
    width: 1,
    style: 'solid',
    color: 'black'
}
```

### Callback:

In context of callback you have two parameters, one is div representing line, and second used options

```js
$.line(x1, y1, x2, y2, opt, function (div, opt) {
    ...
})
```



# License

The MIT License (MIT)

Copyright (c) 2014 Szymon Działowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
npm package: @stoqey/aurum-broker-ibkr
Description: <h1 align="center">IBKR LIVE TRADING (AURUM)</h1>
Author: Stoqey Inc
Latest version: 1.1.9

<h1 align="center">IBKR LIVE TRADING (AURUM)</h1>

<p align="center">
<a href="https://www.npmjs.com/package/@stoqey/aurum-broker-ibkr">
<img alt="NPM" src="https://img.shields.io/npm/dt/@stoqey/aurum-broker-ibkr.svg"></img>
</a>

</p>


<p align="center">
A broker implementation for aurum using <a href="https://github.com/stoqey/ibkr">IBKR</a>
</p>
<p align="center">Production-ready 😎😎😎</p>

####  [Aurum broker API v0.0.7](https://github.com/stoqey/aurum-broker-spec)
## Broker methods

| Method            | Progress |
| ----------------- | -------- |
| init              | ✅        |
| getAccountSummary | ✅        |
| getOpenOrders     | ✅        |
| getAllPositions   | ✅        |
| enterPosition     | ✅        |
| exitPosition      | ✅        |
| searchSymbol      | ❌        |
| quoteSymbol       | ❌        |
| getMarketData     | ✅        |
| getPriceUpdate    | ✅        |

## Broker events
| Method        | Progress |
| ------------- | -------- |
| onReady       | ✅        |
| onPortfolios  | ✅        |
| onOrder       | ✅        |
| onMarketData  | ✅        |
| onPriceUpdate | ✅        |


### Installation
```bash
npm i @stoqey/aurum-broker-ibkr
```

### Usage
```ts
import { IbkrBroker } from '@stoqey/aurum-broker-ibkr';

const broker = new IbkrBroker();

// register events
broker.when('onReady', async () => {
    console.log('IBKR broker is ready');

    // Get price updates
    broker.getPriceUpdate({ symbol: "AAPL" });
});

broker.when("onPriceUpdate", async ({ symbol, close, ...others }) => {
    console.log('on price updates data is', symbol);
});


// start the broker
broker.init();


```

## Other implementations
- [Mille paper trading broker](https://github.com/stoqey/aurum-broker-mille)


STOQEY INC
npm package: @stoqey/aurum-broker-mille
Description: ## Broker methods
Author: Stoqey Inc
Latest version: 1.0.4

<h1 align="center">MILLE PAPER TRADING (AURUM)</h1>

<p align="center">
<a href="https://www.npmjs.com/package/@stoqey/aurum-broker-mille">
<img alt="NPM" src="https://img.shields.io/npm/dt/@stoqey/aurum-broker-mille.svg"></img>
</a>

</p>


<p align="center">
A broker implementation for aurum using <a href="https://github.com/stoqey/mille">Mille paper trading</a>
</p>

####  [Aurum broker API v0.0.8](https://github.com/stoqey/aurum-broker-spec)

## Broker methods

| Method            | Progress |
| ----------------- | -------- |
| init              | ✅        |
| getAccountSummary | ✅        |
| getOpenOrders     | ✅        |
| getAllPositions   | ✅        |
| enterPosition     | ✅        |
| exitPosition      | ✅        |
| searchSymbol      | ❌        |
| quoteSymbol       | ✅        |
| getMarketData     | ✅        |
| getPriceUpdate    | ✅        |

## Broker events
| Method        | Progress |
| ------------- | -------- |
| onReady       | ✅        |
| onPortfolios  | ✅        |
| onOrder       | ✅        |
| onMarketData  | ✅        |
| onPriceUpdate | ✅        |


### Installation
```bash
npm i @stoqey/aurum-broker-ibkr
```

### Usage

```ts
import { MilleBroker } from '@stoqey/aurum-broker-mille';

const broker = new MilleBroker(new Date("2020-03-10 09:30:00"));

// register events
broker.when('onReady', async () => {
    console.log('Mille broker is ready');

    // Get price updates
    broker.getPriceUpdate({ symbol: "AAPL" });
});

broker.when("onPriceUpdate", async ({ symbol, close, ...others }) => {
    console.log('on price updates data is', symbol);
});


// start the broker
broker.init();


```


## Other implementations
- [Interactive brokers](https://github.com/stoqey/aurum-broker-ibkr)


STOQEY INC
npm package: @stoqey/finnhub
Description: NodeJS Finhubb wrapper
Author: Ceddy Muhoza
Latest version: 0.3.4

# Finnhub - NodeJS Wrapper

<img alt="NPM" src="https://circleci.com/gh/stoqey/finnhub.svg?style=svg"></img>

#### Features

- Candles
- Tick
- Quote
- Real-time price updates
- Company Profile2
- Recommendation Trends
- Peers

### Install
```
npm i @stoqey/finnhub

or

yarn add @stoqey/finnhub
```

### Initialize
Set env variable `FINNHUB_KEY` with the token you get from Finnhub.

or simply assign it from the constructors

```ts
import FinnhubAPI, { FinnhubWS } from '@stoqey/finnhub';

// For API
const finnhubAPI = new FinnhubAPI(finnHubKey);

// For Websockets
const finnhubWs = new FinnhubWS(finnHubKey); // or leave finnHubKey blank if process.env.FINNHUB_KEY is set
```

### Get Candles
```ts
const candles = await finnhubAPI.getCandles(symbol, startDate, endDate, '1');
```

### Get Ticks
```ts
const ticks = await finnhubAPI.getTick(symbol, date);
```

### Get Quote
```ts
const quote = await finnhubAPI.getQuote(symbol);
```

### Get Company Profile2
```ts
const companyProfile = await finnhubAPI.getCompanyProfile2(symbol);
```

### Get Recommendation Trends
```ts
const recommendations = await finnhubAPI.GetRecommendationTrends(symbol);
```

### Get Peers
```ts
const peers = await finnhubAPI.getPeers(symbol);
```


### Real-time price updates
```ts
finnhubWs.on("onReady", async () => {
        console.log('WS is ready');
});

finnhubWs.on("onData", async (data: TickData) => {
        console.log('WS onData', data);
});

// Add symbol to streaming list
finnhubWs.addSymbol("AAPL");

// Stop streaming symbol
finnhubWs.removeSymbol("AAPL");

```


##
Set `process.env.DEBUG = "finnhub*"` to see all logs
npm package: @stoqey/firestore
Description: NodeJS Firebase Firestore CRUD library
Author: Ceddy Muhoza
Latest version: 0.0.8

## Firestore - NodeJS Firebase Firestore CRUD library

[![npm](https://img.shields.io/npm/dt/@stoqey/firestore.svg)](http://www.npmtrends.com/@stoqey/firestore)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
![TypeScript compatible](https://img.shields.io/badge/typescript-compatible-brightgreen.svg)

- TODO: doc -> GET, CREATE, UPDATE, DELETE
npm package: @stoqey/hennessy
Description: Hennessy - A very special Cognac (Market Data/IBKR/FINNHUB/BINANCE)
Author: Stoqey Inc
Latest version: 0.0.4

<p align="center">
   <h2>Hennessy 🍾🍾🍾</h2>
</p>

<p align="center">
    <img src="./docs/hennessy.png"></img> 
</p>

<p align="center">
   Hennessy 🍾 - A very special Cognac (Market Data/IBKR/FINNHUB/BINANCE)
</p>


#### Features
- Stocks,Forex,Crypto,Options e.t.c realtime websocket prices api


#### Providers
   IBKR, Finnhub, Binance


## Documentation (to-do)
- What is Hennessy
- How to use Hennessy
npm package: @stoqey/mille
Description: The market is always open anytime
Author: Stoqey
Latest version: 0.0.8

## 


<div align="center">

<h1>⌚︎</h1>

<p>
The market is always open anytime
</p>

<img src="docs/rmx.png"></img>
<img src="docs/rm1.png"></img>


</div>

Mille is a day trading tool used to stream market data slowly just as it would when the market is open.

### Problem
- normal backtestings isn't enough to stimulate a real-market environment, sometimes a server might fail, or an order might not be filled, e.t.c all these factors are ignored by most backtesting tools.

### Solution
*Real market-like backtesting (tick by tick)*

Stream market data like a normal trading day. play the data second by second, minute by minute just like the real market.
 

**Market Data**

Stocks: 
  - Interactive brokers 
  - Finnhub

Crypto: 
  - Binance

 `[ insert your favorite broker]`....
npm package: @stoqey/promethazine
Description: Kubernetes Automation on DigitalOcean
Author: Stoqey Inc
Latest version: 0.0.13

<p align="center">
   <h2>Promethazine 👾</h2>
</p>

<p align="center">
    <img src="./docs/logo.png" width="300px"></img> 
</p>

<p align="center">
   Promethazine 👾 - Automate your Kubernetes on Digital Ocean
</p>


#### Features
- AutoScaling
- Create k8s resources, namespaces, deployments, ingress, jobs/cronjobs, services ...etc

#### Infra
- Digital Ocean
- AWS (coming soon)


## Documentation (to-do)
- What is Promethazine
- Project structure
- Kubernetes Automation
npm package: @stoqey/rasputia
Description: Rasputia - The Big Data Bitch
Author: Stoqey Inc
Latest version: 0.0.2

<p align="center">
   <h2>Rasputia 💋</h2>
</p>

<p align="center">
    <img src="./docs/rasputia.png"></img> 
</p>

<p align="center">
   Rasputia 💋 - The Big Data Bitch
</p>


#### Features
- Create/Query/Insert BigQuery


#### Providers
- BigQuery


## Documentation (to-do)
- What is Rasputia
- How to use Rasputia
npm package: @stoqey/timeout-manager
Description: View and Manage NodeJS's timeout and interval as collections
Author: Ceddy Muhoza
Latest version: 0.0.2

# timeout-manager
View and Manage NodeJS's timeout and interval as collections

# Installation

```$ yarn add timeout-manager```


# Usage

```ts
import { timeoutCollection } from '@stoqey/timer-manager';

// creating a timeout
const firstTimeoutID = setTimeout(function () {
    console.log('First timeout, after 5 seconds');
}, 5000);

const secondTimeoutID = setTimeout(function () {
    console.log(timeoutCollection.getAll().map(id => id.uuid));
    console.log('second timeout, after 8 seconds');
}, 8000);

console.log(timeoutCollection.get(firstTimeoutID)); //timeout object

// Removing the first timeout
timeoutCollection.remove(firstTimeoutID);

console.log(timeoutCollection.getAll().map(id => id.uuid));


// Other methods 
timeoutCollection.getScheduled(); //Returns an array of timeout objects that have not yet executed
timeoutCollection.getCompleted(); //Returns an array of timeout objects that have been executed
timeoutCollection.getAll(); //Returns an array of timeout objects

timeoutCollection.removeAll();
```


# Why?

NodeJS will not expose us a simple object or array to view and manage all of our current time-events.
This library exposes the timeouts and intervals in your current node app. In addition, it makes
it possible to manage those time-events on `runtime`.