open-index/open-npm huggingface dataset:
npm package: @hkai-ai/hkai-typescript
Description: 香港人工智能协会的typescript工具包
Author: HKAI - Wendaolee
Latest version: 0.0.2

# hkai-typescript

该包封装了香港人工智能协会平常开发时，会频繁复用的一些类型以及功能函数。我们与 `EffectTS` 的生态强烈兼容。
npm package: @hkamran/prettier-config
Description: My personal Prettier configuration
Author: H. Kamran
Latest version: 1.1.1

# `@hkamran/prettier-config`

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](../../LICENSE.md) [![npm version](https://badge.fury.io/js/%40hkamran%2Fprettier-config.svg)](https://badge.fury.io/js/%40hkamran%2Fprettier-config.svg)

My personal Prettier configuration

## Installation

```bash
$ npm i -D @hkamran/prettier-config
```

## Usage

Add the following key-value pair to your `package.json` file.

```json
"prettier": "@hkamran/prettier-config"
```

## Settings

| Rule            | Setting |
| --------------- | ------- |
| Trailing Commas | all     |
| Tab Width       | 4       |
npm package: @hkaspy/joystick-linux
Description: Thin wrapper around Linux's Joystick API.
Author: hkaspy@gmail.com
Latest version: 1.2.0

# Joystick linux

Thin wrapper around Linux's Joystick API.

## Installation

```sh
npm install @hkaspy/joystick-linux
```

## Usage

Tested on Node.js v14 LTS and v16 LTS.

```js
import Joystick from "@hkaspy/joystick-linux";

const stick = new Joystick("/dev/input/js0");
stick.on("update", (ev) => console.log(ev));
```

Debian (and other Debian-based OSes like Raspberry Pi OS and Ubuntu) has quite good out-of-the-box support for joysticks and gamepads, exposing a unified Joystick API.

So if you manage to connect your gamepad, you can most probably use this module - see [Debian Gamepad Wiki](https://wiki.debian.org/Gamepad)

## API

### new Joystick()

```js
new Joystick(
    // path to your Joystick device
    "/dev/input/js0",
    {
        // first batch of events is the initial state of buttons/axies
        // it gets dropped if you don't set includeInit: true
        includeInit: true,
        // link a mapper function to map these general events to your specific device
        mappingFn: (e) => e,
    }
);
```

## Events

### `update`

Emitted on each button press or exis value change.

```js
stick.on("update", (data) => console.log(data));
```

```js
{
    // if this event is from the initial batch
    isInitial: false,
    // button/axis number
    number: 1,
    // number of milliseconds since an arbitrary point in time (same point in time for all events in one session)
    time: 87465,
    // "BUTTON" or "AXIS"
    type: "BUTTON",
    // 0 or 1 (pressed) for type: BUTTON
    // -32767 to +32767 for type: AXIS
    value: 0,
}
```

### `disconnect`

Emitted when connection to the joystick is lost.

```js
stick.on("disconnect", () => console.log('disconnected'));
```

### `error`

Emitted when there is an error with the joystick device (e.g. the specified path doesn't exist).

```js
stick.on("error", (err) => console.log('Error!', err));
```


## Mappers

Include your custom mapping function to add more information to the event.

See the included [xbox one controller mapper](./mappers/xbox-one.js) for example:
```js
import Joystick from "@hkaspy/joystick-linux";
import { xboxOneMapper } from "@hkaspy/joystick-linux/mappers";

const stick = new Joystick("/dev/input/js0", { mappingFn: xboxOneMapper });
stick.on("update", (ev) => console.log(ev));
```

```js
{
    isInitial: false,
    number: 4,
    time: 87465,
    type: "BUTTON",
    value: 1,
    // friendly button name
    name: "LEFT_BUMPER",
}
```

## Credits

Inspired by the [joystick](https://www.npmjs.com/package/joystick) module, but implemented as a file stream reader, which is more performant for me. On the other hand, this module doesn't do deadzone and sensitivity.
npm package: @hkbautistav/cordova-plugin-camera-roll
Description: Cordova Camera Roll Plugin Ios - Fork by HillaryBautista
Author: Fork by Hillary Bautista
Latest version: 1.0.9

# Cordova Camera Roll

The Cordova Camera Roll plugin makes it easy to read from the camera roll.

Cordova comes with some camera features such as `navigator.camera.getPicture`. The problem is you have no
control over the experience beyond that. On iOS, for example, a modal slides in that lets you choose a picture.

With this plugin you can get a list of all photos and do whatever you want with them after that.

## Installation

```sh
cordova plugin add @hkbautistav/cordova-plugin-camera-roll
```

## Usage

```javascript

CameraRoll.getPhotos(function(photo) {
  // `photo` is an object with `path`, `date`,
  // `thumbnailPath` (android only) and `orientation` (in degrees) (android only).
  //
  // On iOS, paths are prefixed asset-library://
  // So if you are using Angular and ng-src, make sure to whitelist this URL scheme.
  //
  // You can use the paths directly in an img src or as a background-image in CSS.
  //
  // This callback will be called for each photo in the roll. It's async, yo!
  //
  // When the last photo is reached, the callback is called one last time with an empty object.
}, function(err) {
  // Something bad happened :O
}, {
  count: 12, // Optional, will only return the last N photos.
});

// (iOS only) Quickly save a base-64 encoded data uri to the camera roll.
CameraRoll.saveToCameraRoll(base64String, function() {
  // File saved
}, function(err) {
  // Something bad happened :O
});

```


## About this module

Originally created by Max Lynch [@maxlynch](http://twitter.com/maxlynch), with Android support by Jeremy Bouillanne [johnnyoin](https://github.com/johnnyoin).

Tested on Cordova android 5.1.1 and Cordova ios 4.1.1.

### TODO

* Change the interface to have a single success callback called once, with the full list of photos.
npm package: @hkbyte/sql
Description: HK Byte SQL library
Author: Harshit Kunal LLP
Latest version: 1.2.4

# @hkbyte/sql

> **A transaction oriented SQL library for Node.js**

Library has easy to use promise based transactions which can be shared with multiple function so no need for nested promises now. It also support multi-dialect query building with knex. Currently **PostgreSQL** databases are supported. This library uses [pg](https://preview.npmjs.com/package/pg 'pg'). Library is only possible with integration of [knex](https://www.npmjs.com/package/knex 'Knex'). Node.js versions 10+ are supported.

**Features :**

-   SQL Transaction
-   Sharable Transaction
-   Query building with knex
npm package: @hkbyte/webapi
Description: HK Byte Library for HK WebAPI Server
Author: Harshit Kunal LLP
Latest version: 3.1.0

# @hkbyte/webapi

> **A WebAPI oriented NodeJS server**

**Features :**

-   Built-in validation support
-   Multipart/Form-data support
-   HTTP friendly errors
-   Express middleware support
-   Built-in typescript declarations

<br>

**Let's Create Server :**

```ts
import { WebApiServer } from '@hkbyte/webapi'

const port = 3000
const server = new WebApiServer(port)

server.start().then((port) => {
    console.log(`Server listening on port: ${port}`)
})
```

<br>
WebApiServer options:

```ts
const server = new WebApiServer(port, {
    cors: boolean, // optional, default false
    corsOptions: {}, // optional
    helmet: true, // optional, applies express-helmet plugin to all apis, default false
    helmetOptions: {}, // optional
})
```

for corsOptions refer [here](https://www.npmjs.com/package/cors#configuration-options)
for helmetOptions refer [here](https://www.npmjs.com/package/helmet)

<br>

**Register Express Middleware :**

```ts
const server = new WebApiServer(port)
server.addMiddlewares(middleware_1, middleware_2, ..., middleware_n)
```

<br>

**Create WebAPI (REST-API) :**

```ts
import { WebApiServer, WebApi } from '@hkbyte/webapi'

const server = new WebApiServer(port)

const apiAdminList = new WebApi({
    method: 'GET',
    endpoint: '/admin/list',
    handler: async () => {
        const adminList = await db.fetchAllAdmins()
        return adminList
    },
})

/**
 * Register webApi into our server
 * */
server.addWebApis(apiAdminList, ...)
```

_handler()_ function takes responsibility of sending response data.
By default if request executes successfully it will send HTTP Status Code 200.

<br>
WebApi options:

```ts
const api1 = new WebApi(port, {
    method: 'POST', // 'GET', 'POST', 'PUT', 'PATCH', 'DELETE',
    endpoint: 'product/add' // path with params,
    requestType: 'JSON' // optional 'JSON'(default), 'FORM_DATA_MULTIPART',
    requestBodySchema: TypeObject // body validation schema
    hideErrorStack: false // default true when NODE_ENV = 'production'
    middlewares: [middleware1, middleware2] // API level middlewares
    handler: (context) => {
        const params = context.params // request path params
        const query = context.query // request query string in object
        const body = context.body // request body

        /**
         * Logic goes here
         */

        return responseData
    }
})
```

<br>
WebApi example:

```ts
import { T, WebApi} from '@hkbyte/webapi'

const apiStudentAdd = new WebApi(port, {
    method: 'POST',
    endpoint: 'student/add'
    requestType: 'JSON'
    requestBodySchema: T.object({
		name: T.string().max(50),
		age: T.number().positive(),
	})
    handler: ({ body }) => {
        const newStudent = db.createStudent({
            name: body.name,
            age: body.age,
        })

        return newStudent
    }
})
```
npm package: @hkdex-tmp/sdk-core
Description: ⚒️ An SDK for building applications on top of Uniswap V3
Latest version: 1.0.2

# Uniswap SDK Core

[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest)

This code is shared across Uniswap TypeScript SDKs.
npm package: @hkdex-tmp/universal-router-sdk
Description: sdk for integrating with the Universal Router contracts
Latest version: 1.0.2

# universal-router-sdk
This SDK facilitates interactions with the contracts in [Universal Router](https://github.com/Uniswap/universal-router)

## Usage
Install latest version of universal-router-sdk. Then import the corresponding Trade class and Data object for each protocol you'd like to interact with.

### Trading on Uniswap
warning: `swapERC20CallParameters()` to be deprecated in favor of `swapCallParameters()`
```typescript
import { TradeType } from '@uniswap/sdk-core'
import { Trade as V2TradeSDK } from '@uniswap/v2-sdk'
import { Trade as V3TradeSDK } from '@uniswap/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@uniswap/router-sdk'

const options = { slippageTolerance, recipient }
const routerTrade = new RouterTrade({ v2Routes, v3Routes, mixedRoutes, tradeType: TradeType.EXACT_INPUT })
// Use the raw calldata and value returned to call into Universal Swap Router contracts
const { calldata, value } = SwapRouter.swapCallParameters(routerTrade, options)
```

## Running this package
Make sure you are running `node v18`
Install dependencies and run typescript unit tests
```bash
yarn install
yarn test:hardhat
```

Run forge integration tests
```bash
forge install
yarn test:forge
```
npm package: @hkdex-tmp/universal_router_sdk
Description: sdk for integrating with the Universal Router contracts
Latest version: 1.0.4

# universal-router-sdk
This SDK facilitates interactions with the contracts in [Universal Router](https://github.com/Uniswap/universal-router)

## Usage
Install latest version of universal-router-sdk. Then import the corresponding Trade class and Data object for each protocol you'd like to interact with.

### Trading on Uniswap
warning: `swapERC20CallParameters()` to be deprecated in favor of `swapCallParameters()`
```typescript
import { TradeType } from '@uniswap/sdk-core'
import { Trade as V2TradeSDK } from '@uniswap/v2-sdk'
import { Trade as V3TradeSDK } from '@uniswap/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@uniswap/router-sdk'

const options = { slippageTolerance, recipient }
const routerTrade = new RouterTrade({ v2Routes, v3Routes, mixedRoutes, tradeType: TradeType.EXACT_INPUT })
// Use the raw calldata and value returned to call into Universal Swap Router contracts
const { calldata, value } = SwapRouter.swapCallParameters(routerTrade, options)
```

## Running this package
Make sure you are running `node v18`
Install dependencies and run typescript unit tests
```bash
yarn install
yarn test:hardhat
```

Run forge integration tests
```bash
forge install
yarn test:forge
```
npm package: @hke/ms-fileservice
Description: file microservice
Latest version: 1.0.4

# @hke/ms-fileservice

[![npm version](https://badge.fury.io/js/%40hke%2Fms-fileservice.svg)](https://badge.fury.io/js/%40hke%2Fms-fileservice)
[![Build Status](https://travis-ci.org/hkeio/fileservice.svg?branch=master)](https://travis-ci.org/hkeio/fileservice)
[![Maintainability](https://api.codeclimate.com/v1/badges/d364d3dc09e4a83d4f35/maintainability)](https://codeclimate.com/github/hkeio/fileservice/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/d364d3dc09e4a83d4f35/test_coverage)](https://codeclimate.com/github/hkeio/fileservice/test_coverage)

REST Fileservice with versioning and parallel datatypes

### Routes

```
GET http://localhost:3300/info // shows version, uptime, server timestamp
GET http://localhost:3300/ // shows all files
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738 // shows one file
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/detail // shows all versions and types for one file
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/download // downloads file
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/download/1 // downloads version 1 default type of file
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/download/pdf // downloads latest version type pdf of file
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/download/pdf/1 // downloads downloads type pdf version 1 of file
GET http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/download/1/pdf // downloads downloads type pdf version 1 of file

POST http://localhost:3300/ // adds new file
POST http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738 // adds new version of file
POST http://localhost:3300/c16512c0-5842-4aa0-9579-4f4ba15c8738/true // adds parallel type to latest version
```

#### Todo

- [x] Add [nconf](https://www.npmjs.com/package/nconf)
- [ ] Add authentication
- [ ] Add proper documentation
- [x] Add other tests than postman