open-index/open-npm huggingface dataset:
npm package: @fasto/hooks
Description: These package contains react hooks.
Author: Aman Khanakia
Latest version: 0.0.5

# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
  languageOptions: {
    // other options...
    parserOptions: {
      project: ['./tsconfig.node.json', './tsconfig.app.json'],
      tsconfigRootDir: import.meta.dirname,
    },
  },
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
  // Set the react version
  settings: { react: { version: '18.3' } },
  plugins: {
    // Add the react plugin
    react,
  },
  rules: {
    // other rules...
    // Enable its recommended rules
    ...react.configs.recommended.rules,
    ...react.configs['jsx-runtime'].rules,
  },
})
```
npm package: @fasto/icons
Description: Icons package for react.
Author: Aman Khanakia
Latest version: 0.0.5

# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
  languageOptions: {
    // other options...
    parserOptions: {
      project: ['./tsconfig.node.json', './tsconfig.app.json'],
      tsconfigRootDir: import.meta.dirname,
    },
  },
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
  // Set the react version
  settings: { react: { version: '18.3' } },
  plugins: {
    // Add the react plugin
    react,
  },
  rules: {
    // other rules...
    // Enable its recommended rules
    ...react.configs.recommended.rules,
    ...react.configs['jsx-runtime'].rules,
  },
})
```
npm package: @fasto/ui
Description: These package contains everyday useful functions.
Author: Aman Khanakia
Latest version: 1.0.4

# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
  languageOptions: {
    // other options...
    parserOptions: {
      project: ['./tsconfig.node.json', './tsconfig.app.json'],
      tsconfigRootDir: import.meta.dirname,
    },
  },
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
  // Set the react version
  settings: { react: { version: '18.3' } },
  plugins: {
    // Add the react plugin
    react,
  },
  rules: {
    // other rules...
    // Enable its recommended rules
    ...react.configs.recommended.rules,
    ...react.configs['jsx-runtime'].rules,
  },
})
```
npm package: @fasto/utils
Description: These package contains everyday useful functions.
Author: Aman Khanakia
Latest version: 0.2.1

# Fasto Utils

Utility functions to be used with any js library or application.

## isBlank

```ts
import { isBlank } from '@fasto/utils'
isBlank('')
```

## Issues

React router and vite strated throwing erorr after upgrade so had to add `type=module` in package.json file and this fixed the issue

```
10:32:30 AM [vite] (ssr) Error when evaluating SSR module virtual:react-router/server-build: The requested module '@fasto/utils' does not provide an export named 'isBlank'
      at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
      at ModuleJob.run (node:internal/modules/esm/module_job:217:5)
      at ModuleLoader.import (node:internal/modules/esm/loader:316:24)
      at SSRCompatModuleRunner.directRequest (file:///Volumes/D/www/projects/thewildai/chatbot_app_rr/node_modules/.pnpm/vite@6.2.0_@types+node@22.10.10_jiti@2.4.2_lightningcss@1.29.1_yaml@2.7.0/node_modules/vite/dist/node/module-runner.js:1220:24)
      at SSRCompatModuleRunner.cachedRequest (file:///Volumes/D/www/projects/thewildai/chatbot_app_rr/node_modules/.pnpm/vite@6.2.0_@types+node@22.10.10_jiti@2.4.2_lightningcss@1.29.1_yaml@2.7.0/node_modules/vite/dist/node/module-runner.js:1167:76)
      at eval (/Volumes/D/www/projects/thewildai/chatbot_app_rr/app/components/RootLayout.tsx:4:31)
      at ESModulesEvaluator.runInlinedModule (file:///Volumes/D/www/projects/thewildai/chatbot_app_rr/node_modules/.pnpm/vite@6.2.0_@types+node@22.10.10_jiti@2.4.2_lightningcss@1.29.1_yaml@2.7.0/node_modules/vite/dist/node/module-runner.js:1049:5)
      at SSRCompatModuleRunner.directRequest (file:///Volumes/D/www/projects/thewildai/chatbot_app_rr/node_modules/.pnpm/vite@6.2.0_@types+node@22.10.10_jiti@2.4.2_lightningcss@1.29.1_yaml@2.7.0/node_modules/vite/dist/node/module-runner.js:1271:61)
      at SSRCompatModuleRunner.directRequest (file:///Volumes/D/www/projects/thewildai/chatbot_app_rr/node_modules/.pnpm/vite@6.2.0_@types+node@22.10.10_jiti@2.4.2_lightningcss@1.29.1_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:30913:23)
      at SSRCompatModuleRunner.cachedRequest (file:///Volumes/D/www/projects/thewildai/chatbot_app_rr/node_modules/.pnpm/vite@6.2.0_@types+node@22.10.10_jiti@2.4.2_lightningcss@1.29.1_yaml@2.7.0/node_modules/vite/dist/node/module-runner.js:1167:76)
10:32:30 AM [vite] (ssr) Error when evaluating SSR module virtual:react-router/server-build: The requested module '@fasto/utils' does not provide an export named 'isBlank'
```
npm package: @fastone/eslint-config
Description: ESLint config to rule them all
Author: fastone
Latest version: 1.0.12

# @fastone/eslint-config

![npm (scoped)](https://img.shields.io/npm/v/%40fastone/eslint-config?style=social&logo=npm)
![npm](https://img.shields.io/npm/dt/%40fastone%2Feslint-config?style=social&logo=npm)
![GitHub stars](https://img.shields.io/github/stars/fastone/eslint-config.svg?style=social&logo=github)
## Description

This is a sharable eslint config for TypeScript React projects.
One config to rule all them projects.

## Installation

To install the package run

```sh
foo@bar:~$ npm install @fastone/eslint-config
```

Create `.eslintrc.cjs` in the root of your project with the following content:

```js
/** @type {import('eslint').Linter.Config} */
export default {
    extends: ['@fastone/eslint-config'],
    parserOptions: {
        tsconfigRootDir: __dirname
    }
};
```

## Linting

After you've added the following to your `package.json`:

```json
"scripts": {
    "lint": "eslint --ext .ts,.tsx .",
    "lint:fix": "eslint --ext .ts,.tsx . --fix"
}
```

You'll be able to run the linting commands with:

```sh
foo@bar:~$ npm run lint
foo@bar:~$ npm run lint:fix
```

## VSCode

You can also add the following to your `.vscode/settings.json` to lint on save:
( You need to install the `Prettier - Code formatter` [esbenp.prettier-vscode] extension)

```json
{
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
}
```

### Parsing error: ESLint was configured....

To hide the following error from vscode:

```
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/.eslintrc.cjs` using `parserOptions.project`
```

add the following to your `.eslintrc.cjs`:

```js
ignorePatterns: ['**/*.config.js', '**/*.config.cjs', '**/*.config.ts', '**/*.config.tsx', '.eslintrc.cjs'],
```

## To Do

-   [ ] Double check and update the rules while using it in a real project
npm package: @fastpack/flow_parser
Description: Fastpack-specific package for flow_parser
Latest version: 0.81.0

# flow_parser
Flow parser with Fastpack-specific modifications

# Upgrading the Flow version

Change version in the `Makefile` and `package.json` and run:
```bash
$ make clean && make flow
```

Copy the parser code to `lib/`:
```bash
$ cp -R flow/src/parser/* lib
```

Manually modify `lib/parser_env.mli`:
```
36a37
+   types_in_comments: bool;

```

And `lib/parser_env.ml`:
```
161a162
+   types_in_comments: bool;
170a172
+   types_in_comments = true;
229c231
-   let enable_types_in_comments = parse_options.types in
---
+   let enable_types_in_comments = parse_options.types && parse_options.types_in_comments in
```

Make sure it compiles and test passes:
```bash
$ make test
...
types_in_comments=false: OK
types_in_comments=true: OK
```

To publish the package, run:
```
$ npm publish
```
npm package: @fastpanel/console
Description: Create console (cli) application in NestJS framework context.
Author: Desionlab
Latest version: 1.0.0

# fastPanel [console]
Create console (cli) application in NestJS framework context.

> The a wrapper "[caporal](https://caporal.io/)" lib for use in "[nestjs](https://nestjs.com/)" framework.

## Install

### Stable
```bash
npm i @fastpanel/console
```

### Develop
```bash
npm i @fastpanel/console --registry https://npmjs.desionlab.net
```

## Usage

1. Add command providers.

```typescript
/**
 * pizza.commands.ts
 */

import { Injectable } from '@nestjs/common';
import { Console, Command, Argument, Option } from '@fastpanel/console';

@Console({ name: 'pizza' })
@Injectable()
export class PizzaCommands {
  @Command({ name: 'order', description: 'Order a pizza' })
  @Argument({ synopsis: '<type>', description: 'Type of pizza' })
  @Option({ synopsis: '-e, --extra-ingredients <ingredients>', description: 'Extra ingredients' })
  public async orderAction({ logger, args, options }) {
    logger.info('Order received: %s', args.type);

    if (options.extraIngredients) {
      logger.info('Extra: %s', options.extraIngredients);
    }
  }

  @Command({ name: 'cancel', description: 'Cancel an order' })
  @Argument({ synopsis: '<order-id>', description: 'Order id' })
  public async cancelAction({ logger, args }) {
    logger.info('Order canceled: %s', args.orderId);
  }
}
```

2. Add console module and command providers to app module.

```typescript
/**
 * app.module.ts
 */

import { Module } from '@nestjs/common';
import { ConsoleModule } from '@fastpanel/console';
import { PizzaCommands } from './pizza.commands.ts';

@Module({
  imports: [
    ConsoleModule.forRoot({
      name: 'my-test-app',
      version: '1.0.0',
      description: 'My test app'
    })
  ],
  providers: [PizzaCommands]
})
export class AppModule {}
```

3. Create application context.

```typescript
/**
 * cli.ts
 */

import { NestFactory } from '@nestjs/core';
import { ConsoleService } from '@fastpanel/console';
import { AppModule } from './app.module';

async function bootstrap() {
  /* Create app instant. */
  const app = await NestFactory.createApplicationContext(AppModule, {
    logger: false
  });

  /* Get console service. */
  const consoleService = app.get<ConsoleService>(ConsoleService);

  /* Add default help command. */
  consoleService.getHandler.action(async ({ program }) => {
    await program.exec(['help']);
  });

  /* Run cli handler. */
  await consoleService.run();

  /* End app. */
  await app.close();
}

/* Run app. */
bootstrap();
```

4. Add scripts to package.json

```json
{
  "scripts": {
    "console": "node dist/cli.js",
    "console:dev": "ts-node -r tsconfig-paths/register src/cli.ts"
  }
}
```

5. Use in terminal.

```bash
# Run in development mode
npm run console:dev -- help
npm run console:dev -- command-name

# Run in prod or build mode
npm run console -- help
npm run console -- command-name
```

## License

[MIT licensed](LICENSE).
npm package: @fastpanel/core
Description: The main core of the "fastPanel" system.
Author: Desionlab
Latest version: 0.2.1-alpha.3

# fastPanel Core.
The main core of the "fastPanel" system.

---

## Env

```
  # Defines the current environment.
  # Can be: "develop", "staging", "production".
  NODE_ENV='develop'

  # Defines app settings.
  APP_NAME='fastPanel'
  APP_CLI_BIN='node build/cli.js'

  # Defines a folder structure of the application.
  APP_PATH='App'
  CONFIG_PATH='App/Config'
  LOGGER_PATH='App/Logs'
```

---

## Commands

### setup

Configure components.

```
  Options:
    --help       Output usage information.
    -e, --env    Save as current environment settings.
    -f, --force  Forced reconfiguration of components.
```

``` bash
  node build/cli.js setup
```

---

## Events

### watchdog

The event is triggered every second. Be extremely careful USE OF THE EVENTS.

``` typescript
  this.events.on('watchdog', (app: Application) => {});
```

### cli:getCommands

The event is triggered when the application is ready to register console commands.

``` typescript
  this.events.once('cli:getCommands', (cli: Caporal) => {});
```

---

## License
The MIT License (MIT)

---

## Copyright
(c) 2014 - 2019 Desionlab
npm package: @fastpanel/http
Description: Extension to work with the "HTTP" protocol.
Author: Desionlab
Latest version: 0.2.1-alpha.4

# fastPanel HTTP Extension.
Extension to work with the "HTTP" protocol.

---

## Env

```
# Defines the HTTP (Express) environment.
WEB_HOST=0.0.0.0
WEB_PORT=3001
WEB_DOMAIN=localhost
```

---

## License
The MIT License (MIT)

---

## Copyright
(c) 2014 - 2019 Desionlab
npm package: @fastpanel/mongo
Description: Extension to work with "MongoDB" base.
Author: Desionlab
Latest version: 0.2.1-alpha.3

# fastPanel MongoDB Extension.
Extension to work with "MongoDB" base.

---

## Env

```
# Defines the MongoDB environment.
MONGODB_HOST='localhost'
MONGODB_PORT=27017
MONGODB_USER=''
MONGODB_PASS=''
MONGODB_DBNAME='fastPanel'

# Connection options.
MONGODB_AUTO_RECONNECT=true
MONGODB_RECONNECT_TRIES=9999
MONGODB_RECONNECT_INTERVAL=500
MONGODB_POOL_SIZE=10
```

---

## Events

### cli:getCommands

The event is triggered when the application is ready to register mongoose models.

``` typescript
  this.events.once('db:getModels', async (db: Mongoose.Connection) => {});
```

---

## License
The MIT License (MIT)

---

## Copyright
(c) 2014 - 2019 Desionlab
npm package: @fastpanel/redis
Description: Extension to work with the "Redis" service.
Author: Desionlab
Latest version: 0.2.1-alpha.3

# fastPanel Redis.
Extension to work with the "Redis" service.

---

## Env

```
  # Defines the redis environment.
  # Can be: "default", "cluster".
  REDIS_TYPE='default'

  # For default.
  REDIS_HOST='127.0.0.1'
  REDIS_PORT=6379

  # For cluster.
  REDIS_HOSTS='192.168.1.2:6379;192.168.1.3:6379'

  # For all types.
  REDIS_OPTIONS_FAMILY=4
  REDIS_OPTIONS_PASSWORD=''
  REDIS_OPTIONS_DB=0
  REDIS_OPTIONS_KEY_PREFIX='fastpanel:'
```

---

## License
The MIT License (MIT)

---

## Copyright
(c) 2018 - 2019 Desionlab
npm package: @fastproxy/pfork
Description: fork process
Author: avenwu
Latest version: 0.6.0

# pfork
用于在后台运行程序中启动一个进程执行相应的脚本

# Installation

	npm install pfork --save
	
# Usage
	var p = require('pfork');
	var options = {
		script: '/User/xxx/test/script.js', //必填
		value: '/User/xxx/test/server.js',  //可选
		//其它字段
	};
	//会根据script和value自动去重
	p.fork(options, function(err, data, child) {
		//启动结束
		//child.on('data', function(data) {});
		//child.sendData(data);
		//child.on('exit', function() {}); //退出的时候
	});
	
/User/xxx/test/script.js

	//options与fork的options字段一致
	module.exports = function(options, callback) {
		//do sth
		// process.sendData(data);
		callback(err, data);
	}；
	
kill process：

	p.kill({
		script: '/User/xxx/test/script.js',
		value: '/User/xxx/test/server.js'
	});
	
判断进程是否已存在：

	p.exists({
		script: '/User/xxx/test/script.js',
		value: '/User/xxx/test/server.js'
	});