open-index/open-npm huggingface dataset:
npm package: @sengokuswap/sdk
Description: 🛠 An SDK for building applications on top of Sengokuswap.
Author: songhungbk
Latest version: 1.2.0

# SENGOKUSWAP SDK

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Actions Status](https://github.com/Uniswap/uniswap-sdk/workflows/CI/badge.svg)](https://github.com/Uniswap/uniswap-sdk)
[![npm version](https://img.shields.io/npm/v/@uniswap/sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk/v/latest)
[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk@latest)

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/CodeXSky/sengokuswap-sdk
```

Move into the uniswap-sdk working directory

```sh
cd sengokuswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @sengokyu/perpetual-calendar
Description: Generate date array of the months.
Author: sengokyu
Latest version: 1.0.1

# @sengokyu/perpetual-calendar

Generate Date object array by month.

# Usage

## TypeScript

```typescript
import { PerpetualCalendar } from '@sengokyu/pepetual-calendar';

// Parameter1 = year
// Parameter2 = month (0-11)
// Parameter3 = generate length
const cal = PerpetualCalendar.generate(2020, 11, 2);
// Result:
// [
//     [ new Date(2020, 11, 1), new Date(2020, 11, 2), new Date(2020, 11, 3), /* (snip...) */ new Date(2020, 11, 31) ],
//     [ new Date(2021, 0, 1), new Date(2021, 0, 2), new Date(2021, 0, 3), /* (snip...) */ new Date(2021, 0, 31) ]
// ]
```
npm package: @sengsara/react-to-pdf
Description: Create pdf documents from React Components
Author: Marcos Andrei Ivanechtchuk
Latest version: 0.0.13

# React to PDF

Easily create pdf documents from React components.

## Install

```
$ npm install react-to-pdf
```

## Important Notes

- No SSR
- Single page
- Not vectorized - the pdf is created from a screenshot of the component and therefore is not vectorized. If you are looking for something more advanced for generating pdf using React components, please check out other popular alternatives packages listed below.

## Alternatives and Similars Packages

* [@react-pdf/renderer](https://www.npmjs.com/package/@react-pdf/renderer) - React renderer for creating PDF files on the browser and server
* [react-pdf](https://www.npmjs.com/package/react-pdf) - Display PDFs in your React app as easily as if they were images.


## Examples

https://codesandbox.io/s/l2l4pz0jyl

## Usage

**Using inner target ref**

```jsx
<ReactToPdf>
    {({toPdf, targetRef}) =>  (
        <div style={{width: 500, height: 500, background: 'red'}} onClick={toPdf} ref={targetRef}/>
    )}
</ReactToPdf>
```

**Using outer target ref**

```jsx
const ref = React.createRef();

<div>
    <ReactToPdf targetRef={ref} filename="div-blue.pdf">
        {({toPdf}) => (
            <button onClick={toPdf}>Generate pdf</button>
        )}
    </ReactToPdf>
    <div style={{width: 500, height: 500, background: 'blue'}} ref={ref}/>
</div>
```

**Advanced options**
```jsx
const ref = React.createRef();
const options = {
    orientation: 'landscape',
    unit: 'in',
    format: [4,2]
};
<div>
    <ReactToPdf targetRef={ref} filename="div-blue.pdf" options={options} x={.5} y={.5} scale={0.8}>
        {({toPdf}) => (
            <button onClick={toPdf}>Generate pdf</button>
        )}
    </ReactToPdf>
    <div style={{width: 500, height: 500, background: 'blue'}} ref={ref}/>
</div>
```

## Props

|Prop name        |Type               |Default            |Description
|-----------------|-------------------|-------------------|--------------------------------
|filename         | `string`          | `'download.pdf'`  | Name of the pdf file
|targetRef        | `RefObject`       |                   | [React ref](https://reactjs.org/docs/refs-and-the-dom.html) for the target component (use this or inner target reference)
|x                | `number`          |         0         | X position in document
|y                | `number`          |         0         | Y position in document
|options          | `object`          |    `undefined`    | options for the jsPdf document - [view more details](https://rawgit.com/MrRio/jsPDF/master/docs/)
|onComplete       | `function`        |    `undefined`    | callback executed when process is finished
|scale            | `number`          |    1              | Image scaling
npm package: @senhainfo/fb-connection
Description: This is the `Senha Firebird Connection` lib to execute queries on Firebird.
Author: Bruno Gaspar
Latest version: 1.2.17

# Firebird Connection • senha-fb-connection

This is the `Senha Firebird Connection` lib to execute queries on Firebird.

This lib has the purpose to share the functions across multiples `Senha` projects.
npm package: @senhung/client-service
Description: 🏄🏼‍♂️ Client side service for senhung websites
Author: Senhung Wong
Latest version: 1.0.0

# Client Service

![Travis (.org)](https://img.shields.io/travis/senhungwong/client-service.svg?style=flat-square)
[![GitHub](https://img.shields.io/github/license/senhungwong/client-service.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![npm](https://img.shields.io/npm/v/@senhung/client-service.svg?style=flat-square)](https://www.npmjs.com/package/@senhung/client-service)

## Description

The module contains some common functions that will be used in the front end of senhung.net.

## Install

```
npm install @senhung/client-service
```

OR

```
yarn add @senhung/client-service
```

## Functions

Check out [tests](https://github.com/senhungwong/client-service/tree/master/tests) to see example of usages.
npm package: @senhung/http-exceptions
Description: ⚠️ Http server side error exceptions
Author: Senhung Wong
Latest version: 1.1.1

# Http Exceptions

![Travis (.org)](https://img.shields.io/travis/senhungwong/http-exceptions.svg?style=flat-square)
[![GitHub](https://img.shields.io/github/license/senhungwong/http-exceptions.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![npm](https://img.shields.io/npm/v/@senhung/http-exceptions.svg?style=flat-square)](https://www.npmjs.com/package/@senhung/http-exceptions)


## Install

```bash
$ npm install @senhung/http-exceptions --save
```

OR

```bash
$ yarn add @senhung/http-exceptions
```

## Example Express.js Usage

```javascript
const HttpExceptions = require('@senhung/http-exceptions');
const express        = require('express');

/* create express app */
const app = express();

/* define an app endpoint */
app.get('/', (req, res) => {
    throw new HttpExceptions.NotImplementedHttpException('This method is not implemented yet');
});

/* handle exceptions generally */
app.use((err, req, res, next) => {
    /* http exceptions handling */
    if (err instanceof HttpExceptions.HttpException) {
        return res.status(err.getStatusCode()).json(err.getMessage() ? {message: err.getMessage()} : {});
    }

    /* other errors */
    res.sandStatus(500);
});
```

OR

```javascript
const HttpExceptions = require('@senhung/http-exceptions');
const express        = require('express');

/* create express router  */
const router = new express.Router();

/* define a route endpoint */
router.get('/', (req, res, next) => {
    return next(new HttpExceptions.NotImplementedHttpException('This method is not implemented yet'));
});

/* create express app */
const app = express();

/* use router */
app.use(router);

/* handle exceptions generally */
app.use((err, req, res, next) => {
    /* http exceptions handling */
    if (err instanceof HttpExceptions.HttpException) {
        return res.status(err.getStatusCode()).json(err.getMessage() ? {message: err.getMessage()} : {});
    }

    /* other errors */
    res.sandStatus(500);
});
```

## Tests

```bash
$ npm test
```
npm package: @senhung/http-resource
Description: 📦 Http resource transformer
Author: Senhung Wong
Latest version: 0.1.0

# Http Resource

![Travis (.org)](https://img.shields.io/travis/senhungwong/http-resource.svg?style=flat-square)
[![GitHub](https://img.shields.io/github/license/senhungwong/http-resource.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![npm](https://img.shields.io/npm/v/@senhung/http-resource.svg?style=flat-square)](https://www.npmjs.com/package/@senhung/http-resource)

## Description

Transform http resources to a JSON response.

## Install

```bash
$ npm install @senhung/http-resource
```

## Example

### Example resource definition

```js
const { Resource, ResourceCollection } = require('@senhung/http-resource');

/**
 * An example user resource class for testing
 */
class UserResource extends Resource
{
    toJson(resource) {
        return {
            id: resource._id,
            username: resource.username,
        }
    }
}

module.exports = {
    make:       (resource)  => new UserResource(resource),
    collection: (resources) => new ResourceCollection(resources, UserResource),
};
```

### Example usage

```js
const UserResource = require('./UserResource');

/**
 * A dummy user for testing
 */
const user = {
    _id: 'randomidstring',
    username: 'test_user',
    password: 'somehashedvalue',
    __v: 0,
};

/**
 * A dummy user for testing
 */
const user2 = {
    _id: 'anotheruserid',
    username: 'second_user',
    password: 'somehashedvalue',
    __v: 0,
};

/**
 * A dummy user collection
 */
const users = [user, user2];

/**
 * A show api
 */
router.get('/:userId', (req, res) => {
    res.json(UserResource.make(user).response());
});

/**
 * An index api
 */
router.get('/', (req, res) => {
    res.json(UserResource.collection(users).response());
});
```

### Example output

```
GET /:userId

Response:

{
    data: {
        id: 'randomidstring',
        username: 'test_user'
    }
}
```

```
GET /

Response:

{
    data: [
        {
            id: 'randomidstring',
            username: 'test_user'
        },
        {
            id: 'anotheruserid',
            username: 'second_user'
        }
    ]
}
```