open-index/open-npm huggingface dataset:
npm package: @otoniel19/filetype.js
Description: filetype.js get the type of file by extension name using node.js
Latest version: 1.1.5

# filetype.js

> filetype.js and a module to let you get information from a extension
> <br>
> Information from [FileInfo - The File Extensions Database](https://fileinfo.com)

# usage

> filetype.js supports all mimetypes in [mimedb](https://raw.githubusercontent.com/jshttp/mime-db/master/db.json)

# get info by extension or mimetype

```js
const filetype = require("@otoniel19/filetype.js");
filetype.get("js").then(console.log); // by extension
filetype.get("application/javascript"); //by mimetype
```

- output:

```json
{
  "extname": "js",
  "results": [
    {
      "name": "JavaScript File",
      "description": "A JS file is a text file containing JavaScript code that is used to execute JavaScript instructions in webpages. It may include functions that open and close windows, validate form fields, enable rollover images, or create dropdown menus.",
      "mimetype": "application/javascript",
      "category": "web",
      "type": "text",
      "popularity": "[Object]"
    },
    {
      "name": "JScript Executable Script",
      "description": "JS files are referenced by webpages that incorporate JavaScript functions. They are usually imported in the or sections of the HTML. JS files are helpful when the same JavaScript code is used in multiple webpages as they allow the different pages to reference the code in the one external JS file.",
      "mimetype": "application/javascript",
      "category": "executable",
      "type": "unknown",
      "popularity": "[Object]"
    }
  ]
}
```

# search by extension info

> you can search by name or mimetype

```js
const filetype = require("@otoniel19/filetype.js");
filetype.search("js").then(console.log);
```

- output:

```json
{
  "searchBy": "js",
  "results": []
}
```

> the search has too many results.

# cli

- you can run filetype --help to see commands

```sh
$ filetype --help
> Usage: filetype [options] [command]
> filetype view the type of file
>
> Options:
>  -V, --version   output the version number
>  -h, --help      display help for command
>
> Commands:
>  cache           show the cache
>  get <extname>   get the file type info
>  search <name>   search by extensions
>  help [command]  display help for command
```
npm package: @otoniel19/require-all
Description: require-all import all from a module
Author: otoniel19
Latest version: 1.0.2

# require-all

> import all from a module

- usage

```js
const reqAll = require("@otoniel19/require-all");
reqAll("fs"); // inform the module name

const test = readFileSync("./test.js").toString();
console.log(test);
/*
 will output: 
   const reqAll = require("./index");
   reqAll("fs");

   readFile("./test.js", (err, dt) => {
     console.log(dt.toString());
   });
*/
```
npm package: @otoniel19/super-prompt
Description: super-prompt ask prompts on terminal listen keypress and more...
Author: otoniel19
Latest version: 1.0.1

# super-prompt

> Ask Prompts on terminal with history and keypress events.

# install

> npm install @otoniel19/super-prompt

# usage

> super-prompt already have jsdocs

```js
const superPrompt = require("@otoniel19/super-prompt");
const question = new superPrompt("historyFile", {
  persist: false,
  close: true
});
question.ask("enter name: ".red, (cb) => {
  console.log(cb);
});
```
npm package: @otools/babel-preset-config
Description: babel preset
Author: owenwong
Latest version: 0.1.2
Deprecated: this package has been deprecated

# `@otools/babel-preset-config`

## Usage

```js
// babel.config.js
module.exports = {
  presets: ['@otools/babel-preset-config'],
}
```

## Features

- [x] `TypeScript`
- [x] `React`(include [`react-hot-loader`](https://github.com/gaearon/react-hot-loader))
- [x] `NODE_ENV`/`BABEL_ENV` support
  - [x] `development`: used in development mode
  - [x] `test`: used in test
  - [x] `production`: used in production mode
npm package: @otools/babel-preset-otool
Description: babel preset
Author: owenwong
Latest version: 0.0.25

# `@otools/babel-preset-otool`

## Usage

```js
// babel.config.js
module.exports = {
  presets: ['@otools/babel-preset-otool'],
}
```

## Features

- [x] `TypeScript`
- [x] `React`(include [`react-hot-loader`](https://github.com/gaearon/react-hot-loader))
- [x] `NODE_ENV`/`BABEL_ENV` support
  - [x] `development`: used in development mode
  - [x] `test`: used in test
  - [x] `production`: used in production mode
npm package: @otools/el-description
Description: description componet based on element ui
Author: owenwong
Latest version: 0.4.0

<!--
 * @Descripttion:
 * @Author: OwenWong
 * @Email: owen.cq.cn@gmail.com
 * @Date: 2021-07-19 17:11:12
-->

# @otools/el-description

> el-description

## Install

```bash
npm i @otools/el-description
```

## Usage

```js
import { ElDescription, ElDescriptionItem } from '@otools/el-description'

Vue.use(ElDescription)
Vue.use(ElDescriptionItem)
```

## Attributes

### Description

| 参数       | 说明                                                   | 类型          | 默认值  | 可选值 | 示例        |
| ---------- | ------------------------------------------------------ | ------------- | ------- | ------ | ----------- |
| data       | 数据源(动态数据必传,为了监听数据重绘,非动态数据可不传) | object        | {}      | -      | -           |
| title      | 描述列表的标题,显示在最顶部                            | string/vnode  | -       | -      | -           |
| margin     | 组件边距                                               | string        | -       | -      | '10px 20px' |
| column     | 显示行数                                               | number/string | 3       | -      | 2           |
| size       | 设置列表的大小,可以设置为 small                        | string        | default | small  | -           |
| labelWidth | Descltem 的 label 宽度                                 | string        | 120px   | -      | -           |

### Description Item

| 参数  | 说明             | 类型         | 默认值 | 可选值 | 示例 |
| ----- | ---------------- | ------------ | ------ | ------ | ---- |
| label | 内容的描述(必传) | string/vnode | -      | -      | -    |
| span  | 所占的格数       | number       | 1      | -      | 2    |

### Description Item Slot

| 参数    | 说明                 | 类型         | 默认值 | 可选值 | 示例 |
| ------- | -------------------- | ------------ | ------ | ------ | ---- |
| default | 仅支持纯文本的插槽   | string       | -      | -      | -    |
| content | 支持纯文本、dom 插槽 | string/vnode | -      | -      | -    |
npm package: @otools/eslint-config-otool
Description: eslint config
Author: owenwong
Latest version: 0.0.25

# `@otools/eslint-config-otool`

> eslint config used by `TypeScript`

## Usage

```bash
npm install @otools/eslint-config-otool -D
```

```json
{
  "extends": ["@otools/eslint-config-otool"]
}
```
npm package: @otools/eslint-typescript-config
Description: eslint config
Author: owenwong
Latest version: 0.1.2
Deprecated: this package has been deprecated

# `@otools/eslint-typescript-config`

> eslint config used by `TypeScript`

## Usage

```bash
npm install @otools/eslint-typescript-config -D
```

```json
{
  "extends": ["@otools/eslint-typescript-config"]
}
```
npm package: @otools/pdf-reader-vue
Description: pdf reader for vue
Author: owenwong
Latest version: 0.4.0

# @otools/pdf-reader-vue

> pdf reader for vue

## Install

```bash
npm i @otools/pdf-reader-vue
```

## Usage

- tips: before using, you need copy the `worker.js` manually or configure in vue.config.js, form package to your project static directory.

```js
import PdfReader from '@otools/pdf-reader-vue'

Vue.use(PdfViewer)
```
npm package: @otools/prettier-config-config
Description: prettier config
Author: owenwong
Latest version: 0.1.2
Deprecated: this package has been deprecated

# `@otools/prettier-config-pangu`

> prettier config used by react app in pangu

## Usage

```bash
npm install @otools/prettier-config-pangu -D
```

add `prettier` field in `package.json`

```json
{
  "prettier": "@otools/prettier-config-pangu"
}
```
npm package: @otools/prettier-config-otool
Description: prettier config
Author: owenwong
Latest version: 0.0.25

# `@otools/prettier-config-otool`

> prettier config used by react app

## Usage

```bash
npm install @otools/prettier-config-otool -D
```

add `prettier` field in `package.json`

```json
{
  "prettier": "@otools/prettier-config-otool"
}
```
npm package: @otools/request
Description: http request util based on Fetch API
Author: owenwong
Latest version: 0.4.0

# Request

> http request for browser based on `window.fetch`

## Install

```bash
npm install @otools/request
```

## Usage

```js
import Request from "@otools/request";

const request = new Request({
  baseURL: "https://example.com",
});

request.get("/posts/{id}", {
  params: { id: 1 },
});
request.post("/posts", {
  body: { content: "content" },
});
request.put("/posts/{id}", {
  params: { id: 1 },
  body: { content: "content" },
});
request.patch("/posts/{id}", {
  params: { id: 1 },
  body: { content: "content" },
});
request.del("/posts/{id}", {
  params: { id: 1 },
});
```

## API

### Base API

- `new Request(options?)`

  - `options.baseURL`: optional, base url for each request
  - `options.headers`: optional,default headers
  - `options.beforeRequest`: optional,hook will be called before send request, see [below](#beforeRequest)
  - `options.afterRequest`: optional,hook will be called after receive response, see [below](#afterRequest)

- `request.get(url, Req)`: send http request use `GET`
- `request.post(url, Req)`: send http request use `POST`
- `request.put(url, Req)`: send http request use `PUT`
- `request.patch(url, Req)`: send http request use `PATCH`
- `request.del(url, Req)`: send http request use `DELETE`

### beforeRequest

- type: `(req: Req) => Promise<Req>`

### afterRequest

- type: `(res: Res) => Promise<Res>`

### Req

request config

- `body`: request body
- `headers`: request headers
- `query`: request query params
- `params`: request path params

### Res

original `fetch` response, but with `res.data`, which is serialized from `res.body` based on `Content-Type`
npm package: @otools/vuex-hooks
Description: vue mapper hooks, you can use mapper in vue SFC easily
Author: owenwong
Latest version: 0.4.0

<!--
 * @Descripttion:
 * @Author: OwenWong
 * @Email: owen.cq.cn@gmail.com
 * @Date: 2021-07-28 11:25:14
-->

# @otools/vuex-hooks

> vue mapper hooks, you can use mapper functions in vue SFC easily

## Install

```bash
npm install @otools/vuex-hooks
```

## Usage

```js
<script setup>
import { useState, useActions, useGetters } from '@otools/vuex-hooks'

const storeState = useState(nameSpace, [key1, key2])
const storeActions = useActions(nameSpace, [key1, key2])
const storeGetters = useGetters(nameSpace, [key1, key2])

// ...
</script>
```
npm package: @otools/web-cli
Description: generate front-end project base template.
Author: owenwong
Latest version: 0.0.1

<!--
 * @Descripttion:
 * @Author: OwenWong
 * @Email: owen.cq.cn@gmail.com
 * @Date: 2021-10-21 10:31:40
-->

# web starter cli

> generate front end project base template.
npm package: @otools/websocket
Description: websocket util for browser
Author: owenwong
Latest version: 0.4.0

<!--
 * @Descripttion:
 * @Author: OwenWong
 * @Email: owen.cq.cn@gmail.com
 * @Date: 2021-07-28 11:25:14
-->

# Websocket

> websocket for browser

## Install

```bash
npm install @otools/websocket
```

## Usage

```js
import Websocket from '@otools/websocket'

const ws = new Websocket('ws://example.com')
ws.connect(() => {
  console.log('ws connected')
})
ws.send('msg')
ws.onMessage((res) => {
  console.log('receive message from service')
})
ws.onError((err) => {
  console.error('websocket occurred error')
})
ws.close(() => {
  console.log('ws closed')
})
```
npm package: @otosense/ogui
Description: ## to use yarn link in the intalled  1. install @otosense/ogui (yarn add @otosense/ogui) 2. ./client run 'yarn link @otosense/ogui'
Author: ADI OtoSense team
Latest version: 1.1.2

# ogui

## to use yarn link in the intalled 
1. install @otosense/ogui (yarn add @otosense/ogui)
2. ./client run 'yarn link @otosense/ogui'

## components' props

### Pipeline maker
```
interface IProps {
  options: string[];
  handleSelectChange: (val: string, i: number) => void;
  handleSave: VoidFunction;
  selectedValues: string[];
  setSelectedValues: (arr: string[]) => void;
  isMixedData?: boolean;
  mixedData?: any;
  filterMixedDataFunc?: (data: any) => string[];
}
```
### Stream2pyChart
```
interface IProps {
  arr: {X: number}[];
  setArr: VoidFunction;
  speed: number;
}
```
speed is in millisecond (1000 is 1 sec)
npm package: @otovo/shared-components
Description: Shared components library for Cloud apps
Author: otovo
Latest version: 1.0.45

# React components

> Otovo's React components for Cloud

## Getting started

### 1. Install `@otovo/shared-components`

```sh
yarn add @otovo/shared-components
```

### 2. Build `@otovo/shared-components`

```sh
yarn build
```

### 3. Release a new version `@otovo/shared-components`

Assuming that you are logged in to your yarn account.

```sh
yarn publish
```

## Working locally with `@otovo/shared-components`

Install [yalc](https://www.npmjs.com/package/yalc) globally, i.e. `yarn global add yalc`

Then run

```sh
yalc publish
```

to publish the package in a local store on your computer.

In the repository you want to import the package in, run

```sh
yalc add @otovo/shared-components@<whatever version you published>`, # e.g., `@otovo/shared-components@1.0.0
```

Then you should see your local package in node_modules in the the repository of your choice.