open-index/open-npm huggingface dataset:
npm package: @flowx/npm-cli
Description: 命令行工具
Latest version: 1.0.14

# NPM-CLI

命令行工具

## Usage

```bash
$ npm i -g @flowx/npm-cli
```

### Registry

```bash
$ npc registry [-d|--delete]
```

### Connect with NPC

```bash
$ npm i -g @flowx/npm-cli
$ npc r
# type the registry url and select yes to confirm
# test:
$ npc view react
```

### Choose Installer Mode

```bash
$ npc use
```

你可以选择使用`npm`或者`npminstall`模式来安装模块。默认选择`npm`。

## Plugins

任意存在 `.npc` 文件夹下以 `.cmd.js` 结尾的文件都将被认为是插件。插件写法如下:

```js
const { Command } = require('commander');
const c = module.exports = new Command();
c.name('aa')
c.action(() => {
  console.log('bb')
})
```

它将自动被npc加载:

```bash
$ npc aa # bb
```

搜索目录:

1. `node_modules` 下所有插件
2. `process.cwd()` 同级 `.npc` 文件夹
npm package: @flowx/redis
Description: redis cache for typeservice
Author: cevio
Latest version: 1.0.12

# @flowxjs/redis

基于TypeService的Redis缓存框架

## Install

```bash
$ npm i @flowxjs/redis
```

## Usage

```ts
import { cacheable, TypeRedis, buildCache, deleteCache } from '@flowx/redis';

const x = new TypeRedis({
  host: '129.211.10.111',
  memory: true,
});

class ABC {
  @cacheable('test:${0}:ttt:${1}', 3600)
  sum(a: number, b: number) {
    return a + b;
  }
}

const t = new ABC();

Promise.resolve(t.sum(8, 3))
.then(d => console.log('first value:', d))
.then(() => Promise.resolve(t.sum(8, 3)))
.then(d => console.log('cache value:', d))
.then(() => x.get('test:8:ttt:3'))
.then(d => console.log('redirect value:', d))
.then(() => buildCache(ABC, 'sum', 8, 3))
.then(() => t.sum(8, 3))
.then(d => console.log('build value:', d))
.then(() => deleteCache(ABC, 'sum', 8, 3))
.then(() => x.get('test:8:ttt:3'))
.then(d => console.log('delete value:', d));
```

output:

```
first value: 11
cache value: 11
redirect value: 11
build value: 11
delete value: undefined
```
npm package: @flowx/typeorm
Description: typeorm for typeservice
Author: cevio
Latest version: 1.0.3

# @flowxjs/typeorm

基于TypeService的ORM框架

## Install

```bash
$ npm i @flowxjs/typeorm
```

## Usage

```ts
import { TypeORM } from '@flowx/typeorm';
const orm = new TypeORM(container);

const [setBinding, setInitializer] = orm.useEntity(options);

setBinding('MySQL'); // 在container上绑定MySQL链接对象 通过 @inject('MySQL')来调用。
setInitializer(async conn => {}); // 做初始化的事情
```
npm package: @flowxjs/typeorm
Description: typeorm for typeservice
Author: cevio
Latest version: 1.0.0

# @flowxjs/typeorm

基于TypeService的ORM框架

## Install

```bash
$ npm i @flowxjs/typeorm
```

## Usage

```ts
import { TypeORM } from '@flowx/typeorm';
const orm = new TypeORM(container);

const [setBinding, setInitializer] = orm.useEntity(options);

setBinding('MySQL'); // 在container上绑定MySQL链接对象 通过 @inject('MySQL')来调用。
setInitializer(async conn => {}); // 做初始化的事情
```
npm package: @flowxjs/typeservice
Description: Native nodejs server container framework
Author: evio
Latest version: 1.0.4

#  TypeService

基于`Nodejs`的容器服务启动器，通过插件模式可扩展具体应用实例。

## Usage

安装模块

```bash
$ npm i @flowxjs/typeservice
```

创建一个日志文件 `src/app.logger.ts`

```ts
export type TTypeServiceLogger = Console;
export const TypeServiceLogger = console;
```

创建一个启动文件 `src/app.bootstrap.ts`

```ts
import { Factory, TTypeServiceFactoryBootstrapInstance, TypeServiceFactoryInstance, TAnnotationScanerResult } from '@flowxjs/typeservice';
import { TTypeServiceLogger, TypeServiceLogger } from './app.logger';
import { Plugin } from './app.plugin';

@Factory.Logger(TypeServiceLogger)
@Factory.Setup(Plugin)
export class ApplicationFactory extends TypeServiceFactoryInstance<TTypeServiceLogger> implements TTypeServiceFactoryBootstrapInstance {
  message(value: any) {
    if (value instanceof Error) return this.factory.logger.error(value);
    this.factory.logger.info(value);
  }

  initialize(meta: TAnnotationScanerResult) {
    console.log('factory initialize', meta);
  }

  terminate(meta: TAnnotationScanerResult) {
    console.log('factory terminate', meta);
  }
}
```

创建一个插件文件 `src/app.plugin.ts`

```ts
import { TypeServiceFactoryInstance, TTypeServiceLifeCycleInstance, TAnnotationScanerResult } from '@flowxjs/typeservice';
import { TTypeServiceLogger } from './app.logger';

export class Plugin extends TypeServiceFactoryInstance<TTypeServiceLogger> implements TTypeServiceLifeCycleInstance {
  async initialize(meta: TAnnotationScanerResult) {
    console.log('plugin initialize', meta);
    await new Promise(resolve => setTimeout(resolve, 2000));
  }

  async terminate(meta: TAnnotationScanerResult) {
    await new Promise(resolve => setTimeout(resolve, 3000));
    console.log('plugin terminate', meta);
  }
}
```

## CLI

使用命令行工具

- 启动开发程序 `ts-dev`
- 启动PM2托管 `ts-pm2-start`
- 停止PM2托管 `ts-pm2-stop`
- 重启PM2托管 `ts-pm2-restart`
- 删除PM2托管 `ts-pm2-delete`
npm package: @flowxo/twa
Description: Flow XO client for Telegram Web Apps
Author: Nathan Stults
Latest version: 1.3.0

# @flowxo/twa

> Flow XO Telegram Web App Client

## Install

```bash
npm install @flowxo/twa
```

## Usage

```ts
import { FlowXOClient } from '@flowxo/twa';

clinet = new FlowXOClient({webApp: window.Telegram.WebApp});
client.fetchUserProfile().then((profile) => {
    console.log(profile)
})
client.updateUserProfile({attributes:{new:"attribute"}}).then((updated) => {
    console.log(updated)
})
client.event('myEvent', { my:"data"});
```
## Types
```ts
export interface UserProfile {
  id: string;
  name: string;
  firstName: string;
  lastName: string;
  timezone: string;
  country: string;
  locale: string;
  gender: string;
  email: string;
  phone: string;
  company: string;
  firstMessage: string;
  lastMessage: string;
  status: string;
  bot: {
    id: string;
    name: string;
  };
  attributes: Record<string, string>;
  segments: {
    id: string;
    name: string;
  }[];
}

export interface UserProfileUpdate {
  name: string;
  firstName: string;
  lastName: string;
  timezone: string;
  country: string;
  locale: string;
  gender: string;
  email: string;
  phone: string;
  company: string;
  status: string;
  attributes: Record<string, string>;
  segments: {
    add?: string[],
    remove?: string[],
    replace?: string[]
  }[];
}
```
npm package: @flox/fork
Description: Redux effects support for non blocking async calls.
Latest version: 0.1.5


# fork

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Non blocking async call effects.

## Installation

    $ npm install @floxjs/fork

## Usage

```js
import forkEffect, {fork, join} from '@floxjs/fork'

const store = applyMiddleware(flo(), forkEffect)(createStore)(reducer, {})

function * child () {
  yield delay(5)
  return 'foo'
}

store.dispatch(function * () {
  const task = yield fork(child)

  // do some things

  yield join(task) // => 'foo'

})
```

## API

### fork(fn)
Action creator.

- `fn` - function, generator, or iterator to fork

**Returns:** a task

### join(task)
Action creator.

- `task` - task to block on

**Returns:** result of task

### cancel(task)
Action creator. Throws error in running task with message: 'TaskCanceled'.

- `task` - task to cancel

### taskRunner(dispatch)
Runs tasks. Used internally by koax.

- `dispatch` - dispatch function

**Returns:** `dispatch`

### task.isRunning()

**Returns:** whether task is running

### task.result()

**Returns:** the result of the task

### task.error()

**Returns:** the error thrown by the task

###task.cancel()
Cancels task
## License

MIT

[travis-image]: https://img.shields.io/travis/floxjs/fork.svg?style=flat-square
[travis-url]: https://travis-ci.org/floxjs/fork
[git-image]: https://img.shields.io/github/tag/floxjs/fork.svg?style=flat-square
[git-url]: https://github.com/floxjs/fork
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@flox/fork.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@flox/fork
npm package: @flox/timing
Description: Delay, timeout, and interval effects.
Latest version: 0.2.0


# timing

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Delay, timeout, and interval effects. (Included in flox)

## Installation

    $ npm install @flox/timing

## Usage

```js
import {delay, timeout, interval} from '@flox/timing'

function * () {
  yield delay(500)
  // do something later
}

function * () {
  yield timeout(doSomethingLater, 500)
  // do something now
}

function * () {
  let task = yield interval(repeatSomething, 500)
  // do something and then cancel
  yield cancel(task)
}

```

## API

### delay(wait)

- `wait` - time to block

**Returns:** delay action

### timeout(fn, wait)

- `fn` - function to run after `wait` ms
- `wait` - time to wait

**Returns:** timeout action

### interval(fn, wait)

- `fn` - function to run on an interval
- `wait` - time in between runs

**Returns:** interval action

## License

MIT

[travis-image]: https://img.shields.io/travis/floxjs/timing.svg?style=flat-square
[travis-url]: https://travis-ci.org/floxjs/timing
[git-image]: https://img.shields.io/github/tag/floxjs/timing.svg?style=flat-square
[git-url]: https://github.com/floxjs/timing
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@flox/timing.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@flox/timing
npm package: @floydnoel/react-kit
Description: My favorite packages and components together, forever.
Author: Floyd Noel
Latest version: 1.0.2

# React Kit

`@floydnoel/react-kit`

<!-- Useful React Components -->

## About

These are some React components that I have needed in projects, they could be useful to others. Enjoy!

## Getting started

### set up an app and add the package

```sh
npx create-react-app [your-app-name]
cd [your-app-name]
yarn add @floydnoel/react-kit
```

### import and use

```jsx
import { Markdown } from '@floydnoel/react-kit'

let title = () => <Markdown># hello, world</Markdown>
```

## Components

- [Markdown](/src/components/markdown)
- [TextField](/src/components/text-field)
- [React Router](/src/components/router)
- [Error Boundary](/src/components/error-boundary)

## Code conventions

- Currently, all filenames are lower case words with hyphen separations.
- Directory structure
  - `react-kit`: root dir, contains configuration and miscellaneous files
    - `.github`: github specific files, such as action workflows
    - `build`: created by `yarn build:docs`, holds the docs static deploy files
    - `dist`: created by `yarn build:components`, contains the npm package built files
    - `node_modules`: installed packages for dev
    - `public`: same as CRA public folder
    - `scripts`: build and run scripts
    - `src`: source code files
      - `components`: source code for components published in the npm package
      - `docs`: docs source code
- Using prettier ([customized](/.prettierrc.json)) and eslint, run `yarn format` to run prettier
npm package: @floydspace/bond-calculator
Description: Yield and price calculations for bonds
Author: Jonathan Goldwasser
Latest version: 0.2.0

# Bond calculator

[![npm version](https://badge.fury.io/js/%40floydspace%2Fbond-calculator.svg)](https://badge.fury.io/js/%40floydspace%2Fbond-calculator)
[![Build Status](https://travis-ci.org/floydspace/bond-calculator.svg?branch=master)](https://travis-ci.org/floydspace/bond-calculator)
[![Coverage Status](https://coveralls.io/repos/github/floydspace/bond-calculator/badge.svg?branch=master)](https://coveralls.io/github/floydspace/bond-calculator?branch=master)

Yield and price calculations for bonds.

Gives the same results as Excel [YIELD](https://support.office.com/en-US/article/YIELD-function-F5F5CA43-C4BD-434F-8BD2-ED3C9727A4FE) and [PRICE](https://support.office.com/en-us/article/PRICE-function-3ea9deac-8dfa-436f-a7c8-17ea02c21b0a) functions.

The following day count conventions are supported:
* 30U/360
* ACTUAL/ACTUAL
* ACTUAL/360
* ACTUAL/365
* 30E/360
* 30/360

More info about day count conventions can be found on [Wikipedia](https://en.wikipedia.org/wiki/Day_count_convention).

## Installation
```
npm install --save @floydspace/bond-calculator
```

## Usage
```javascript
const bondCalculator = require('@floydspace/bond-calculator');

const bond = bondCalculator({
  settlement: '2016-12-26',
  maturity: '2023-01-17',
  rate: 0.02625, // 2.625%
  redemption: 100,
  frequency: 2, // 1=Annual, 2=Semiannual, 4=Quarterly, 12=Monthly
  convention: '30U/360',
});

// Calculate yield for a given price
const yld = bond.yield(98); // 2.98817753210426%

// Calculate price for a given yield
const price = bond.price(0.025); // 100.69785390232649
```