open-index/open-npm huggingface dataset:
npm package: @pollbox/mongo-knex
Description: tbc
Author: Ghost Foundation
Latest version: 0.3.0

# Mongo Knex

## Installation
1. Make sure that `gstenv` is green. See [Dev Environment](https://github.com/TryGhost/Team/blob/master/Engineering/Dev%20Environment.md) for docs.
2. `git clone` this repo & `cd` into it as usual
3. Run `yarn` to install top-level dependencies.

## Run
- Use: `yarn dev`
- View: [http://localhost:9999](http://localhost:9999)

## Test
- `yarn lint` run just eslint
- `yarn test` run lint && tests
- `NODE_ENV=testing-mysql yarn test`
  - Manual database creation is currently required.

## Debug

`DEBUG=mongo-knex:*`
`DEBUG=mongo-knex:converter`
`DEBUG=mongo-knex:converter-extended`

## Config

`config.[env].json`

# Copyright & License

Copyright (c) 2018-2019 Ghost Foundation - Released under the [MIT license](LICENSE).
npm package: @pollbox/nql
Description: tbc
Author: Ghost Foundation
Latest version: 0.2.2

# NQL
The aim is putting together various nql related projects into single, easy to use api. It allows:
 - parsing of NQL expression into Mongo JSON (using [nql-lang](https://github.com/NexesJS/NQL-Lang))
 - enhancing a database query with additional filters based on provided expression (using [mongo-knex](https://github.com/NexesJS/mongo-knex))
 - querying JSON objects with NQL expressions (using [mingo](https://github.com/kofrasa/mingo))

## Installation
Using npm:
```
npm install @nexes/nql --save
```
or with yarn:
```
yarn add @nexes/nql
```

## Example
A simple NQL expression could have following form: `featured:true+slug:['photo', 'video']`
When parsing it to Mongo JSON with `nql(expression).parse()` the output would be:
```javascript
{
    $and: [
        {
            featured: true
        },
        {
            slug: {
                $in: ['photo', 'video']
            }
        }
    ]
}
```

If the same expression would be applied to Knex [QueryBuilder](https://knexjs.org/#Builder) object, the following SQL where statement would be generated:
```sql
where (`posts`.`featured` = true and `posts`.`slug` in ('photo', 'video'))
```

## Usage
Some common usages:
```javascript
nql('id:3').toJSON();
\\ => {id:3}
```

```javascript
nql('id:3').queryJSON({test:true, id:3});
\\ => true
```

```javascript
nql('tags:test', {expansions: {tags: 'tags.slug'}}).toJSON();
\\ => {'tags.slug': test}
```
```javascript
nql('primary_tag:[photo]', {expansions: [
      {key: 'primary_tag', replacement: 'tags.slug', expansion: 'order:0'}
  ]})
\\ => {$and: [{'tags.slug': {$in: ['photo']}}, {order: 0}]}
```

Advanced usage example:

```javascript
// Builds SQL where statement on top of knex Query Builder including:
//  - combining custom filter 'primary_tag:test' with overrides filter and defaults
//  - expanding shortcut property 'primary_tag' into 'tags.slug' and adding 'posts_tags.sort_order:0' filter
//  - builds a where statement with related `tags` table through manyToMany relation
const query = nql('primary_tag:test', {
    relations: {
        tags: {
            tableName: 'tags',
            type: 'manyToMany',
            joinTable: 'posts_tags',
            joinFrom: 'post_id',
            joinTo: 'tag_id'
        }
    },
    expansions: [
        {
            key: 'primary_tag',
            replacement: 'tags.slug',
            expansion: 'posts_tags.sort_order:0'
        }
    ],
    overrides: 'status:published',
    defaults: 'featured:true'
});

query
    .querySQL(knex('posts'))
    .select();
```

## Test
- `yarn lint` run just eslint
- `yarn test` run lint && tests

# Copyright & License

Copyright (c) 2018-2019 Ghost Foundation - Released under the [MIT license](LICENSE).
npm package: @pollbox/nql-lang
Description: tbc
Author: Ghost Foundation
Latest version: 0.0.1

# NQL Lang

## Installation
1. Make sure that `gstenv` is green. See [Dev Environment](https://github.com/TryGhost/Team/blob/master/Engineering/Dev%20Environment.md) for docs.
2. `git clone` this repo & `cd` into it as usual
3. Run `yarn` to install top-level dependencies.

## Run
- Use: `yarn dev`
- View: [http://localhost:9999](http://localhost:9999)

## Test
- `yarn lint` run just eslint
- `yarn test` run lint && tests

# Copyright & License

Copyright (c) 2018-2019 Ghost Foundation - Released under the [MIT license](LICENSE).
npm package: @pollen-solutions/api-request
Description: Pollen Solutions - JS - Api Request
Author: Jordy Manner
Latest version: 0.0.3

# API Request

[![Latest Stable Version](https://img.shields.io/npm/v/@pollen-solutions/api-request.svg?style=for-the-badge)](https://www.npmjs.com/package/@pollen-solutions/api-request)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE.md)

## Installation

```shell
npm i @pollen-solutions/api-request
```

## Usage 

This documentation uses the [API JSON placeholder](https://jsonplaceholder.typicode.com/guide/).

### Basic Usage

```javascript
import {ApiRequest} from "@pollen-solutions/api-request"

ApiRequest(
    'https://jsonplaceholder.typicode.com/posts', /** Endpoint url */
    {_start:0, _limit:5}, /** Data request arguments */
    'GET', /** HTTP Request Method */
    {'X-CUSTOM-HEADER': 'My Custom Header'},  /** HTTP Headers */
    function(json) { 
      console.log(json)
    }, /** Callback function for processing the response in JS format */
    true /** Debug mode enabled */
)
```

### Using promise return

```javascript
import {ApiRequest} from "@pollen-solutions/api-request"

ApiRequest('https://jsonplaceholder.typicode.com/posts', {
  _start: 0,
  _limit: 5
})
    .then(json => console.log(json))
    .finally(() => console.log('ApiRequest complete'))
```


### For a specific HTTP verb 

#### GET Request

```javascript
import {ApiGet} from "@pollen-solutions/api-request"

ApiGet('https://jsonplaceholder.typicode.com/posts').then(json => console.log(json))
```

#### POST Request

```javascript
import {ApiPost} from "@pollen-solutions/api-request"

ApiPost('https://jsonplaceholder.typicode.com/posts', {
  title: 'foo',
  body: 'bar',
  userId: 1,
}).then(json => console.log(json))
```

#### PUT Request

```javascript
import {ApiPut} from "@pollen-solutions/api-request"

ApiPut('https://jsonplaceholder.typicode.com/posts/1', {
  id: 1,
  title: 'foo',
  body: 'bar',
  userId: 1,
}).then(json => console.log(json))
```

#### PATCH Request 

```javascript
import {ApiPatch} from "@pollen-solutions/api-request"

ApiPatch('https://jsonplaceholder.typicode.com/posts/1', {
  title: 'foo',
}).then(json => console.log(json))
```

#### DELETE Request

```javascript
import {ApiDelete} from "@pollen-solutions/api-request"

ApiDelete('https://jsonplaceholder.typicode.com/posts/1')
```
npm package: @pollen-solutions/component
Description: Pollen Solutions - JS - Component
Author: Jordy Manner
Latest version: 0.0.0

# Component

[![Latest Stable Version](https://img.shields.io/npm/v/@pollen-solutions/component.svg?style=for-the-badge)](https://www.npmjs.com/package/@pollen-solutions/component)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE.md)

## Installation

```shell
npm i @pollen-solutions/component
```

## Usage 

```javascript
import {Component} from "@pollen-solutions/component"

myComponent = new Component(document.querySelector('#root'))

myComponent.setOption('sample-option.sub-sample-option', true)

console.log(myComponent.getOption('sample-option'))
```
npm package: @pollen-solutions/selectors-mutation-observer
Description: Pollen Solutions - JS - Selectors Mutation Observer
Author: Jordy Manner
Latest version: 0.0.1

# Selectors Mutation Observer

[![Latest Stable Version](https://img.shields.io/npm/v/@pollen-solutions/selectors-mutation-observer.svg?style=for-the-badge)](https://www.npmjs.com/package/@pollen-solutions/selectors-mutation-observer)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE.md)

## Installation

```shell
npm i @pollen-solutions/selectors-mutation-observer
```

## Usage 

### Observe on a specific ancestor element (recommended)

```javascript
import {SelectorsMutationObserver} from "@pollen-solutions/selectors-mutation-observer"

SelectorsMutationObserver('.element', function ($el, mutationObserverInstance) {
  console.log('HTMLElement with class [.element] was added !!')
}, document.querySelector('ancestor-of-element'))
```

### Observe over the entire DOM (resource consumer)

```javascript
import {SelectorsMutationObserver} from "@pollen-solutions/selectors-mutation-observer"

SelectorsMutationObserver('.element', function ($el, mutationObserverInstance) {
  console.log('HTMLElement with class [.element] was added !!')
})
```