open-index/open-npm huggingface dataset:
npm package: @spklai/fast-gateway
Description: A Node.js API Gateway for the masses!
Author: SparkleAI
Latest version: 3.4.5

# Introduction

This is a fork of [fast-gateway]() with added support for forwarding request headers for websocket connections.

## Usage

One additional option in the `WebSocketRoute`:

```ts
interface WebSocketRoute {
  proxyType: 'websocket';
  proxyConfig?: {}; 
  passRequestHeaders?: boolean; // <-- this one, defaults to false
  prefix: string;
  target: string;
  subProtocols?: [];
  hooks?: WebSocketHooks;
}
```

If `passRequestHeaders` is set to `true`, the request headers will be forwarded to the target server. This is useful for downstream authentication purposes.


## More
- fast-gateway's original website and documentation: https://fgw.21no.de
npm package: @spksoft/koa-decorator
Description: @route decorator for koa-router (fork from https://github.com/gwuhaolin/koa-router-decorator)
Latest version: 1.2.2

# koa-decorator
@route decorator for koa-router

## Use
install by:
```bash
npm i koa-decorator
```
then use in code:
```js
import {HttpMethod, route} from 'koa-decorator';

@route('/monitor')
export default class MonitorCtrl{

  @route('/alive', HttpMethod.GET)
  async alive(ctx) {
    ctx.body = {
      data: true,
    };
  }
}
```
register to router:
```js
import {load} from 'koa-decorator';
const apiRouter = load(path.resolve(__dirname, 'route'), '.route.js');
app.use(apiRouter.routes()).use(apiRouter.allowedMethods());
```

## Use auth middleware
```js
import {HttpMethod, route} from 'koa-decorator';

function auth(ctx) {
  if(!ctx.auth){
      ctx.response.status = 401;
  }
}

@route('/monitor')
export default class MonitorCtrl {

  @route('/alive', HttpMethod.GET,auth)
  async alive(ctx) {
    ctx.body = {
      data: true,
    };
  }
}
```

## Return data direct
The following code has the same effect as above:
```js
@route('/monitor')
export default class MonitorCtrl {

  @route('/alive', HttpMethod.GET,auth)
  async alive() {
    return {
      data: true,
    };
  }
}
```
npm package: @spksoft/koa-validator-decorator
Description: koa-validator-decorator is a ES6 validator decorator by using validator core from yup
Latest version: 1.0.1

# koa-validator-decorator
koa-validator-decorator is a ES6 validator decorator by using validator core from yup

## Install
```
yarn add @spksoft/koa-validator-decorator
```

## Usage
```
import {
  HttpMethod,
  route,
} from '@spksoft/koa-decorator';
import yup from 'yup'
import validate from '@spksoft/koa-validator-decorator'

@route('/v1/hello-world')
export default class HelloWorldController{

  @route('/', HttpMethod.POST)
  @validate({
    body: yup.object().shape({
      name: yup.number().required(),
    }),
  })
  async main(ctx) {
    ctx.body = {
      'hello': 'world'
    };
  }
}

```
npm package: @spksoft/mongoose-repository
Description: A mongoose Repository based
Latest version: 1.1.0

# mongoose-repository
A mongoose Repository based
Include Plugin:
- mongoose-delete (default options: { deletedAt: true, indexFields: true, overrideMethods: true })
- mongoose-timestamps
- mongoose-paginate

### install
```
npm install @spksoft/mongoose-repository
```

### Usage
user.repository.js file
```javascript
import RepositoryBuilder from '@spksoft/mongoose-repository'

const schemaDefinition = {
  name: {
    type: String,
    require: true
  },
  foo: {
    type: [Number],
    require: true
  }
}

export default RepositoryBuilder('Bar', schemaDefinition)
//  {
//      Model,
//      Schema,
//      Repository,
//      schemaDefinition,
//      default: Repository
//  }
```

### Example
find with repository
```javascript
import UserRepository from './user.repository.js'

export default async function getUser() {
  var filter = {
    name: 'Yana'
  }
  var options = {
    limit: 10, // limit data 10 rows
    page: 1, // start 1
    sort: 'username -password', // sort by "username" ascending and "password" descending
    populate: 'userType'
  }
  return UserRepository.find(filter, options)
}
```

find with model
```javascript
import UserRepository from './user.repository.js'

export default async function getUser() {
  var filter = {
    name: 'Yana'
  }
  var options = {
    limit: 10, // limit data 10 rows
    page: 1, // start 1
    sort: 'username -password', // sort by "username" ascending and "password" descending
    populate: 'userType'
  }
  return UserRepository.Model.find(filter, options)
}
```

get schema definition
```javascript
import UserRepository from './user.repository.js'

export default async function getUserSchemaDefinition() {
  return UserRepository.schemaDefinition
}
```

create
```javascript
import UserRepository from './user.repository'
UserRepository.create({
    name: 'eiei',
    foo: [12, 69]
})
```
npm package: @spksoft/nodejs-starter-generator
Description: ## Install ``` npm install -g @spksoft/nodejs-starter-generator ``` ## Run ``` sendit-generator-nodejs <project-name> ```
Author: spksoft
Latest version: 1.1.6

# nodejs-starter-generator

## Install
```
npm install -g @spksoft/nodejs-starter-generator
```
## Run
```
sendit-generator-nodejs <project-name>
```
npm package: @spl-soft-react/language
Description: i18n for react
Author: San Pyae Lin
Latest version: 0.0.102

# i18n

Internationalization (I18N) for reactJs

## Installation 

```sh
npm install @spl-soft-react/language --save
```

## Usage

copy `message` folder to `project/src` 

Wrap your app with LanguageProvider 
```js
import { LanguageProvider } from '@spl-soft-react/language';
import messages from 'project/src/messages'

<LanguageProvider message={messages}>
    <App />
</LanguageProvider>

```

```js
import { withI18n } from '@spl-soft-react/language';

class Example extends React.Component {
  render() {
    const { t, setlanguagecode } = this.props;
    return (
      <div >
        <h1>{t("hello")}</h1>
        <p>{t('update {module-name}', {'module-name': t('product')})}</p>

        <button onClick={()=>setlanguagecode('en')}>English</button>
        <button onClick={()=>setlanguagecode('my')}>Myanmar</button>
        <button onClick={()=>setlanguagecode('zg')}>Myanmar Zawgyi</button>
      </div>
    );
  }
}

export default withi18n(Example);
```


## Other package

[spl-soft-react](https://www.npmjs.com/org/spl-soft-react)
npm package: @splainez/n8n-nodes-phonenumber-parser
Description: Parse a phone number and return its information
Author: splainez
Latest version: 1.2.0

# n8n-nodes-phonenumber-parser

[![version](https://img.shields.io/npm/v/@splainez/n8n-nodes-phonenumber-parser.svg)](https://www.npmjs.org/package/@splainez/n8n-nodes-phonenumber-parser)

## Description

The `PhoneNumberParser` node is a powerful tool for working with phone numbers in your n8n workflows. It uses the `libphonenumber-js` library to format phone numbers into human-readable formats and extract useful information, such as the country code, area code, and phone number.


You can also clone the repository from GitHub and build the package yourself.

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n Community Nodes documentation.

## Usage

To use the `PhoneNumberParser` node in your n8n workflows, drag and drop the node from the node palette onto your workflow canvas. Then, connect the output of any preceding node to the input of the `PhoneNumberParser` node.

The `PhoneNumberParser` node has a single input parameter: the phone number to be formatted. This should be a string containing only digits. Once the node receives the phone number, it will automatically format it into a human-readable format and extract useful information, such as the country code, area code, and phone number. The formatted phone number will be output as a JSON object containing these fields.

This node parses a phone number using the `libphonenumber-js` library and returns its information in JSON format. The following information is included in the output:

* `country`: The country code associated with the phone number.
* `countryCallingCode`: The country calling code of the phone number.
* `nationalNumber`: The national (significant) part of the phone number.
* `formatNational`: The phone number formatted in national format.
* `formatInternational`: The phone number formatted in international format.
* `formatE164`: The phone number formatted in E.164 format.
* `formatRFC3966`: The phone number formatted in RFC3966 format.
* `possible`: Whether the length of the phone number is valid, although it may not necessarily be correctly formatted.
* `valid`: Whether the phone number is valid, based on both length and format.
* `nonGeographic`: Whether the phone number is non-geographic (i.e., not tied to a specific location).
* `type`: The type of phone number (e.g., FIXED_LINE_OR_MOBILE, MOBILE, FIXED_LINE, TOLL_FREE, etc.).


## License

This project is licensed under the MIT License. See the `LICENSE` file for more details.

This project uses the `libphonenumber-js` library, which is also licensed under the MIT License. See the `libphonenumber-js/LICENSE` file for more details.
npm package: @splash-cli/core
Description: Core of @splash-cli/splash-cli
Author: Federico Vitale
Latest version: 1.0.5

# core
> Check if the current month is equalt to the given month

## Install
```sh
	$ npm install @splash-cli/core --save

	#or

	$ yarn add @splash-cli/core
```

## Usage
```js
	import splash from '@splash-cli/core';

	splash(url, flags)
```

## Api
### splash(url, flags)
Core of splash-cli.

#### url
Type: `String`
Unsplash api url

#### flags
Type: `Object`
splash-cli flags

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/is-month
Description: Check if the current month is equalt to the given month
Author: Federico Vitale
Latest version: 1.1.1

# is-month
> Check if the current month is equalt to the given month

## Install
```sh
	$ npm install is-month --save

	#or

	$ yarn add is-month
```

## Usage
```js
	import isMonth from 'is-month';

	isMonth('april', { today: new Date('2018/04/12') }) //=> true
	isMonth.promise('april', { today: new Date('2018/04/12') })
		.then(month => {
			console.log('We are in April!')
		})
		.catch(err => {
			if (err) {
				throw err;
			}
		})
```

## Api
### isMonth(month, { today })
Returns a boolean.

#### month
Type: `String`
Month to check

#### today
Type: `Date`
Default: `new Date()`
Date to check

### isMonth.promise(month, { today })
Returns a promise for a boolean.
#### month
Type: `String`
Month to check

#### today
Type: `Date`
Default: `new Date()`
Date to check

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/parse-exif
Description: Parse unsplash api exifs
Author: Federico Vitale
Latest version: 1.0.0

# parse-exif
> Parse unsplash exif

## Install
```sh
	$ npm install @splash-cli/parse-exif --save

	#or

	$ yarn add @splash-cli/parse-exif
```

## Usage
```js
	import printBlock from '@splash-cli/parse-exif';

	parseExif(data) //=> { model: '...' }
```

## Api
### parseExif(source)
Returns unsplash parsed exif (Object)

#### source
Type: `Object`
Unsplash Api exif

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/path-fixer
Description: > Replace '~' with user home path.
Author: Federico Vitale
Latest version: 1.0.2

# path-fixer
> Replace '~' with user home path.

## Install
```sh
	$ npm install @splash-cli/path-fixer --save

	#or

	$ yarn add @splash-cli/path-fixer
```

## Usage
```js
	import fixPath from '@splash-cli/path-fixer';
	
	console.log(fixPath('~/Desktop')) //=> '/Users/<user>/Desktop'
```

## Api
### fixPath(path)
Returns parsed path.

#### path
Type: `String`
Path to be fixed

### fixPath.promise(path)
Returns promise for parsed path.

#### path
Type: `String`
Path to be fixed

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/print-block
Description: overflow
Author: Federico Vitale
Latest version: 1.0.6

# print-block
> Handle errors

## Install
```sh
	$ npm install @splash-cli/print-block --save

	#or

	$ yarn add @splash-cli/print-block
```

## Usage
```js
	import printBlock from 'print-block';

	printBlock('hello', 'world');
	// or
	printBlock('hello world');
```

## Api
### printBlock(...messages)
print all messages

#### messages
Type: `String`
Messages to be printed

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/show-copy
Description: Show unsplash api copyright infos.
Author: Federico Vitale
Latest version: 1.1.0

# show-copy
> Show unsplash api copyright infos.

## Install
```sh
	$ npm install @splash-cli/show-copy --save

	#or

	$ yarn add @splash-cli/show-copy
```

## Usage
```js
	import showCopy from '@splash-cli/show-copy';

	showCopy(photoData, info) //=> prints infos
```


## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/splash-downloader
Description: Download unsplash api photos
Author: Federico Vitale
Latest version: 1.0.0

# splash-download
> Download unsplash photos

## Install
```sh
	$ npm install @splash-cli/splash-download --save

	#or

	$ yarn add @splash-cli/splash-download
```

## Usage
```js
	import download from '@splash-cli/splash-download';

	download(flags, photInfo, setAsWallpaper);
	//=> promise
```

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/splash-error
Description: overflow
Author: Federico Vitale
Latest version: 1.0.1

# splash-error
> Handle errors

## Install
```sh
	$ npm install @splash-cli/splash-error --save

	#or

	$ yarn add @splash-cli/splash-error
```

## Usage
```js
	import splashError from 'splash-error';

	// ... function
	try {
		const obj = JSON.parse(`{ \"json\": \"true\" }`)
	} catch (error) {
		splashError(error);
	}
```

## Api
### splashError(err, { message, colors })
Throw the given error.

#### err
Type: `Error`
Error to be thrown

#### message
Type: `String`
Default: `Splash Error`
Error message

#### colors
Type: `Object`
Default: `{ message: 'yellow', error: 'red' }`
Text colors

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splash-cli/unit-formatter
Description: Format numbers by adding 'b/k/m' at the end. 1000 => 1k
Author: Federico Vitale
Latest version: 1.0.1

# unit-formatter
> Format numbers by adding 'b/k/m' at the end. 1000 => 1k

## Install
```sh
	$ npm install @splash-cli/unit-formatter --save

	#or

	$ yarn add @splash-cli/unit-formatter
```

## Usage
```js
	import uFormatter from '@splash-cli/unit-formatter';

	console.log( uFormatter(1000) ); //=> '1k'
```

## Api
### uFormatter(num)
Returns formatted number into a string.

#### num
Type: `Number`
Number to be formatted

## License
MIT © [Federico Vitale](https://federicovitale.me)
npm package: @splashdb/cli
Author: heineiuo
Latest version: 0.6.18

# splashdb/cli


## Usage

```sh
$ npm install @splashdb/cli -g
$ export SPLASHDB_URI=https://admin:admin@localhost:8443/system
$ export SPLASHDB_SECURE_CERT=/PATH/TO/splash_secure_cert.pem # if needed
$ splash dump <dumppath> # to dump a database
$ splash restore <dumppath> # to restore a database. notice: the data in dbpath will be kept.

```

## License

[MIT License](./LICENSE)
npm package: @splashdb/client-mongo
Description: **Experimental Mongo-style wrapper for Splashdb Client**
Latest version: 0.4.0
Deprecated: Use @splashdb/client instead

# @splashdb/client-mongo

**Experimental Mongo-style wrapper for Splashdb Client**

Never use it in production.



## Usage

```ts
import { SplashdbClientMongo } from '@splashdb/client-mongo'

async function main(){
  const mongo = new SplashdbClientMongo({ uri: "https://username:passwordlocalhost:8443/system" })

  const results = await mongo.find({
    $collection: 'fruit',
    $skip: 10, 
    $orderby: { count: 1 },
    $query: {
      $and: [
        {
          count: { $gt: 1 }
        },
        {
          category: {
            $in: ["apple", "banana"]
          }
        }
      ]
    }
  }
}

main()

```