open-index/open-npm huggingface dataset:
npm package: @nodeart/event_emitter
Description: Simple EventEmitter pattern
Author: Ivan Prodaiko
Latest version: 1.2.3

[![bitHound Overall Score](https://www.bithound.io/github/NodeArt/EventEmitter/badges/score.svg)](https://www.bithound.io/github/NodeArt/EventEmitter)
[![bitHound Dependencies](https://www.bithound.io/github/NodeArt/EventEmitter/badges/dependencies.svg)](https://www.bithound.io/github/NodeArt/EventEmitter/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/NodeArt/EventEmitter/badges/code.svg)](https://www.bithound.io/github/NodeArt/EventEmitter)

Methods:
```javascript
const EventEmitter = require('@nodeart/event_emitter');
const events = new EventEmitter();
events.on('eventName', ...fns)
      .once('eventName', ...fns)
      .off('eventName', ...fns)
      .emit('eventName', {
          ctx: true
      }, ...args)
      .times('eventName2', 3, ...fns)
      .offAll();

const inherited = {};

// reset prototype
EventEmitter
    .inherit(inherited)
    .on('smth', ...fns);
    
const extended = {};

// add EventEmitter functionality as mixin
EventEmitter
    .extend(extended)
    .on('smth', ...fns);

// One can remove some functions from listeners array by passing them to .off method,
// but to remove all listeners event use .off with eventName only;
```
npm package: @nodeart/firebase-connector
Description: **GoogleAuth**
Latest version: 2.1.56

# Firebase connector

**GoogleAuth**

`google.com` firebaseAuth method

**GithubAuth**

`github.com` firebaseAuth method

**FacebookAuth**

`facebook.com` firebaseAuth method

**PasswordAuth**

email & password firebaseAuth method

**TwitterAuth**

`twitter.com` firebaseAuth method

**AnonymouslyAuth**

anonymous firebaseAuth method

**VkAuth**

`vk.com` is not among standard auth providers in firebase, so we provide our own solution for 
this. To get acquainted with the flow, please, read [this](https://vk.com/dev/implicit_flow_user) article.

In order to avoid creation of http server, vkAuthService works only with firebase and not with REST API.
So, we strongly recommend to set redirect url to be a current location, thus one can get a token on a client side.

Internal work of a service one can found in [source](./src/authMethods/vk.ts)

**Usage:**

`VkConfigService` declaration
```typescript
//vkAuthConfig.service.ts
import {Injectable} from "@angular/core";
import {VkAuthConfig, VkConfig, PopupConfig} from "@nodeart/firebase-connector";

@Injectable()
export class VkConfiguration implements VkAuthConfig {
    public vkConfig : VkConfig = {
        client_id: 'app_id',
        display: 'popup',
        scope: ['friends'],
        response_type: 'token',
        v: 5.63
    };
    public popupConfig: PopupConfig = {
        location: 'no',
        height: 600,
        width: 600
    };
    public cleanUp: boolean = true;
    public dbPath: string = 'auth/vk'; // #1 note that this field should be the same on server and client side #2;
    constructor() { }
}
```
`VkConfigService` register
```typescript
//someModule.module.ts
import {NgModule} from "@angular/core";
import {VkConfiguration} from "./vkAuthConfig.service";
@NgModule({
  providers: [
    {provide: 'VkAuthConfig', useClass: VkConfiguration}
  ]
})
export class SomeModule { }
```

Server side or [firebase cloud functions](https://firebase.google.com/docs/functions/) code:
```javascript
'use strict';

const admin = require('firebase-admin');
// #2 note that this field should be the same on server and client side #1;
const authWithVk = admin.database().ref('auth/vk'); 

const listener = (ref, snapshot) => {
  const key = snapshot.key,
        val = snapshot.val();
        
  if (!val.processed) {
    admin.auth()
        .createCustomToken(val['access_token'])
        .then(token => {
          const data = Object.assign(val, {
            access_token: token,
            expires_in: null,
            processed: true
          });
          ref.child(key).set(data);
          return data
        })
        .then(data => console.log(`custom token generated = ${JSON.stringify(data)}`))
  }
};

authWithVk.on('child_added', snapshot => listener(authWithVk, snapshot));
```
npm package: @nodeart/injector
Description: Depedency injection framework for node.js
Author: Ivan Prodaiko
Latest version: 0.1.5

# Dependency Injection

This module provides dependency injection for browser and node.

### There are **five** resolutionStrategies available:
- `factory` - each time a new instance will be created.
- `singleton` - only one instance will be created.
- `value` - just will be returned.
- `constant` - the same as `value` but can't be reassign.
- `alias` - used to create an alias for some dependency.

## Basic usage:

```javascript
const { Injector } = require('@nodeart/injector');
const injector = new Injector();
class X {
  constructor(a, b) {
    console.log(a, b);
  }
  
  static get $inject() {
    return ['a', 'b'];
  }
}

const depX = Injector.DIConfig.create({
  name: 'X',
  resolutionStrategy: 'factory',
  value: X
});

const depA = Injector.DIConfig.create({
  name: 'a',
  resolutionStrategy: 'value',
  value: 'A'
});

const depB = Injector.DIConfig.create({
  name: 'b',
  resolutionStrategy: 'constant',
  value: 'B'
});

const depC = Injector.DIConfig.create({
  name: 'c',
  resolutionStrategy: 'singleton',
  value: 'C'
});

const alias = Injector.DIConfig.create({
  name: 'aliasForC',
  resolutionStrategy: 'alias',
  value: 'C' // actual dependency
});



injector.register(depX, depA, depC);
injector.resolve('X');

// A B
```

## Node.js usage
Alongside with `Injector`, `InjectorNode` class is available. It inherits from `Injector` and in addition to 
main functionality it can search for modules inside file system.
It can be useful if you write a big node.js project and do not want to manage dependencies on your own.
Just call a `bootstrap` method with the list of folders or files you'd like to register and `InjectorNode` do everything
else for you. To be registered module must exports and instance of `DependencyConfig` class 
(which is the same as calling `Injector.DIConfig.create` method over an object).
If you want a recursive search just pass `true` as a second argument to `bootstrap` method.

```javascript
const { InjectorNode } = require('@nodeart/injector');
const injector = new InjectorNode();

injector.bootstrap([
  '.',
  '../dependencies',
  '../dependency_file.js'
], true);
```
npm package: @nodeart/observable
Description: Simple Observable pattern
Author: Ivan Prodaiko
Latest version: 1.0.15

[![bitHound Overall Score](https://www.bithound.io/github/NodeArt/Observable/badges/score.svg)](https://www.bithound.io/github/NodeArt/Observable)
[![bitHound Dependencies](https://www.bithound.io/github/NodeArt/Observable/badges/dependencies.svg)](https://www.bithound.io/github/NodeArt/Observable/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/NodeArt/Observable/badges/code.svg)](https://www.bithound.io/github/NodeArt/Observable)

**DEPRECATED**

Please, use https://www.npmjs.com/package/@nodeart/event_emitter instead.

Methods:
```javascript
observable.on(eventName, ...fns)
observable.once(eventName, ...fns)
observable.unbind(eventName, ...fns) 
observable.unbindAll()
// One can remove some functions from listeners array,
// but to remove all listeners (read 'remove event'), one can pass
// only eventName to .unbind method
observable.emit(eventName, ...args)
```

Features:
1) any number of functions can be put as listeners
2) chaining available
3) written with ES6 syntax
4) can be used in node.js and in browser
npm package: @nodebasics/datastructures
Description: This is a simple, zero dependencies, package with popular data structures.  This package, although strives to provide high quality code, is new and not yet battle tested for high performance production scenarios. Therefore, consider alternative solutions 
Latest version: 0.3.0

# Node basics - Data structures

This is a simple, zero dependencies, package with popular data structures. 
This package, although strives to provide high quality code, is new and not yet battle tested for high performance production scenarios. Therefore, consider alternative solutions if your use case is sensitive to those factors.

## Current data structures implemented

- Queue
  - Supports enqueue, dequeue, peekFront, peekTail, size, isEmpty, isFull, and collection operations.
  - [Queue documentation](./docs/Queue.md)

- Stack
  - Supports push, pop, peek, size, isEmpty, isFull, and collection operations.
  - [Stack documentation](./docs/Stack.md)


## Installation

To install the package, run:

```sh
npm install @nodebasics/datastructures
```

## Very simple usage example

```javascript
import { Queue, Stack } from '@nodebasics/datastructures';

const queue = new Queue({ maxSize: 10 });
queue.enqueue(1);
queue.enqueue(2);
console.log(queue.dequeue()); // 1
console.log(queue.peekFront()); // 2

const stack = new Stack({ maxSize: 10 });
stack.push(1);
stack.push(2);
console.log(stack.pop()); // 2
console.log(stack.peek()); // 1
```
npm package: @nodebb-community/nodebb-plugin-emailer-mailjet
Description: An emailer plugin for NodeBB using Mailjet as a third party service
Author: Pichalite
Latest version: 3.0.3

# NodeBB Emailer (Mailjet)

This NodeBB plugin allows NodeBB to send emails to users through the third-party transactional email service Mailjet.

To customise options for this plugin, please consult the "Emailer (Mailjet)" page in the administration panel, under the "Plugins" heading.

##Installation

    npm install nodebb-plugin-emailer-mailjet