open-index/open-npm huggingface dataset:
npm package: @signumtte/expo-camera
Description: A React component that renders a preview for the device's either front or back camera. Camera's parameters like zoom, auto focus, white balance and flash mode are adjustable. With expo-camera, one can also take photos and record videos that are saved to t
Author: 650 Industries, Inc.
Latest version: 15.0.9

<p>
  <a href="https://docs.expo.dev/versions/latest/sdk/camera/">
    <img
      src="../../.github/resources/expo-camera.svg"
      alt="expo-camera"
      height="64" />
  </a>
</p>

A React component that renders a preview for the device's either front or back camera. Camera's parameters like zoom, auto focus, white balance and flash mode are adjustable. With expo-camera, one can also take photos and record videos that are saved to the app's cache. Morever, the component is also capable of detecting faces and bar codes appearing on the preview.

# API documentation

- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/camera/)
- [Documentation for the main branch](https://docs.expo.dev/versions/unversioned/sdk/camera/)

# Installation in managed Expo projects

For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/camera/).

# Installation in bare React Native projects

For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.

### Add the package to your npm dependencies

```
npx expo install expo-camera
```

### Configure for Android

This package automatically adds the `CAMERA` permission to your app. If you want to record videos with audio, you have to include the `RECORD_AUDIO`.

```xml
<!-- Added permissions -->
<uses-permission android:name="android.permission.CAMERA" />

<!-- Optional permissions -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

Adjust the `android/build.gradle` to add a new `maven` block after all other repositories as described below:

```gradle
allprojects {
    repositories {

        // * Your other repositories here *

        // * Add a new maven block after other repositories / blocks *
        maven {
            // expo-camera bundles a custom com.google.android:cameraview
            url "$rootDir/../node_modules/expo-camera/android/maven"
        }
    }
}
```

The sourcecode for `cameraview` can be found at [`expo/cameraview`](https://github.com/expo/cameraview).

### Configure for iOS

Add `NSCameraUsageDescription` and `NSMicrophoneUsageDescription` keys to your `Info.plist`:

```xml
<key>NSCameraUsageDescription</key>
<string>Allow $(PRODUCT_NAME) to use the camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow $(PRODUCT_NAME) to use the microphone</string>
```

Run `npx pod-install` after installing the npm package.

# Contributing

Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
npm package: @signup.software/api
Description: the public api client for signup.software
Author: Lossless GmbH
Latest version: 1.0.10

# @signup.software/api
the public api client for signup.software

## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@signup.software/api)
* [gitlab.com (source)](https://gitlab.com/signup.software/api)
* [github.com (source mirror)](https://github.com/signup.software/api)
* [docs (typedoc)](https://signup.software.gitlab.io/api/)

## Status for master

Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/signup.software/api/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/signup.software/api/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@signup.software/api)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/signup.software/api)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@signup.software/api)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@signup.software/api)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@signup.software/api)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)

## Usage

Use TypeScript for best in class intellisense

## Contribution

We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)

For further information read the linked docs at the top of this readme.

> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)

[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
npm package: @signup.software/interfaces
Description: the public interfaces for signup.software
Author: Lossless GmbH
Latest version: 1.0.11

# @signup.software/interfaces
the public interfaces for signup.software

## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@signup.software/interfaces)
* [gitlab.com (source)](https://gitlab.com/signup.software/interfaces)
* [github.com (source mirror)](https://github.com/signup.software/interfaces)
* [docs (typedoc)](https://signup.software.gitlab.io/interfaces/)

## Status for master

Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/signup.software/interfaces/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/signup.software/interfaces/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@signup.software/interfaces)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/signup.software/interfaces)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@signup.software/interfaces)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@signup.software/interfaces)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@signup.software/interfaces)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)

## Usage

Use TypeScript for best in class intellisense

## Contribution

We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)

For further information read the linked docs at the top of this readme.

> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)

[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
npm package: @signuply/node
Description: ```ts const client = createClient({ clientId: '<CLIENT_ID>', clientSecret: '<CLIENT_SECRET>' }); const user = await client.auth.authenticate({ sessionToken: '<SESSION_TOKEN>' }); ```
Latest version: 0.0.50

# @signuply/node

```ts
const client = createClient({ clientId: '<CLIENT_ID>', clientSecret: '<CLIENT_SECRET>' });
const user = await client.auth.authenticate({ sessionToken: '<SESSION_TOKEN>' });
```
npm package: @signuply/react
Description: ## Instllation
Latest version: 0.0.50

# @signuply/react

## Instllation

```sh
npm install -S @signuply/react @signuply/sdk
# or
yarn add @signuply/react @signuply/sdk
```

## Usage

```tsx
import ReactDOM from 'react';
import { Provider, useAuth, Flow } from '@signuply/react';

const App = () => {
  const [{ user }] = useAuth();
  return <div>{user ? `logined: ${user.email}` : <Flow flowId="<FLOW_ID>" />}</div>;
};
ReactDOM.render(
  <Provider clientId="<CLIENT_ID>">
    <App />
  </Provider>,
  document.getElementById('root'),
);
```

## API References

### Provider

```tsx
import { Provider } from '@signuply/react';
```

### Hooks

```tsx
import { useAuth } from '@signuply/react';
```

### Flow

```tsx
import { Flow } from '@signuply/react';
```
npm package: @signuply/secret
Description: ```ts import { createSecretClient } from '@signuply/secret'; import assert from 'assert';
Latest version: 0.0.50

# @signuply/secret

```ts
import { createSecretClient } from '@signuply/secret';
import assert from 'assert';

const secretClient = createSecretClient({
  encryptionKey: '<128BITS_KEY>',
});

// generate cryptographic secret
const secret = await secretClient.generate();
// encrypt with aes-256-cbc
const encrypted = secretClient.encrypt(secret);
const decrypted = secretClient.decrypt(encrypted);
assert.equal(secret, decrypted);

// generate cyptographic hash with hmac algorithm
const hash = secretClient.hash(secret);
```
npm package: @signuply/text-parser
Description: Input:
Latest version: 0.0.50

# @signuply/text-parser

Input:

```
We are [signuply](https://signuply.com).
Thank you for reading this.
```

Output:

```ts
[
  { type: 'text', value: 'We are ' },
  { type: 'url', name: 'signuply', url: 'https://signuply.com' },
  { type: 'text', value: '.' },
  { type: 'line' },
  { type: 'text', value: 'Thank you for reading this.' },
];
```
npm package: @signver/ads-toolkit
Description: NodeJS implementation of as Automation Device Specification compatible server.
Author: Chua Siang Poh
Latest version: 1.0.0



# Blubberfish

A TCP server implementing the ADS protocol as designed by [Beckhoff](https://www.beckhoff.com). 

Hopefully this helps you as a system integrator trying to build your own web-based UI.

The main idea is to integrate the NodeJS application with this library, a HTTP server (e.g. Express), and your web UI (e.g. some React app). Let the application act as the hub where the PLC will store and send data via ADS, while the web UI can similarly share access to said data via HTTP. 

## TODO

Implement the ADS client (this doesn't affect the server capabilities). 

# Usage guide

This will not work if the NodeJS is running on the local machine. If it needs to be hosted on the local machine, one way might be to spin up a VM to host the NodeJS application. 

After creating and starting your NodeJS application, you will need to add the appropriate ADS route to the PLC routing table as specified in their manual. 

Once done, you will simple need to handle the ADS packet accordingly in NodeJS.

# Disclaimer

This library is not yet tested, although the basic idea and functionality should more or less be working. 

This library is created based on resources and data made available via their [infosys](https://infosys.beckhoff.com/index_en.htm) site.
npm package: @signver/handle-chain
Description: Simply utility to create a handler chain.
Author: Chua Siang Poh
Latest version: 3.1.0

# Overview

Simple utility package to create a chain-of-responsibilty-like pattern for any given context.

**Note**: Breaking change as of v3.0.0. See usage guide below for new usage guide.

## Usage guide

The general idea is to define a chain of handlers that will be executed in FIFO order.

```typescript
/* get-data-delegate.ts */
import createDelegation, { 
  Delegate,
  DelegateContext, 
  DelegateResult 
} from '@signver/handle-chain'

type Request = {
    // any request specific data
    // object is frozen internally before passing to delegates
    id: string
}

type State = {
    // any data that might be expected to be passed between delegates
    // object is expected to be mutable
    raw: any
}

type ResponseData = {
  // the ['data'] property of the response object
  // the final output once the last delegate is complete
}

export type CustomDelegateContext = DelegateContext<Request, ResponseData, State>

// initial state factory
export function initialState(): State {
  // ...
}

// ... define rest of delegates
export async function fetchDataDelegate(context: CustomDelegateContext): DelegateResult {
  const data = await Promise.all([
    getRawData1FromID(context.request.id),
    getRawData2FromID(context.request.id),
  ]) 
  if (!data[0] || !data[1]) {
      // stop the delegation prematurely
    return {
      shouldStop: true
    }
  }
  context.state.raw = data
  return {
    shouldStop: false
  }
}
export async function refineDataDelegate(context: CustomDelegateContext): DelegateResult {
  const data = await refineData(context.state.raw)
  // set the final output at context.response.data
  context.setResponse(data)
  return {
    shouldStop: false
  }
}

export default createDelegation({
  // FIFO 
  delegates: [
    fetchDataDelegate,
    refineDataDelegate
  ],
  stateFactory: initialState
})
```
```typescript
import delegate from 'get-data-delegate.ts'

const response = await delegate({
  id: 'some_id'
})

// if any of the delegate function throws an error
// response.encounteredError will be `true`
if (response.encounteredError) {
  doSomethingWith(response.error)
}

// if any of the function could not complete
// if any of the delegate function throws an error
// response.terminatedEarly will also be `true`
if (response.terminatedEarly) {
  // do something
}

doSomethingWith(response.data)
```
npm package: @sigodenjs/dee
Description: A framework focus on document driven design
Author: Sigoden Huang
Latest version: 0.18.4

# Dee - Powered by express and openapi

## Features

- Document driven development
- Use openapi to autobind router, auto parse and verify request.
- Easy to use 3-party service, could be bond through config

## Get started

Install Dee web framework

```
npm i @sigodenjs/dee -S
```

Init Dee App

```js
import * as Dee from "@sigodenjs/dee";
import * as path from "path";
import * as handlers from "./handlers";
import * as DeeIORedis from "@sigodenjs/dee-ioredis";

Dee({
  config: {
    ns: "proj",
    name: "App"
  },
  openapize: {
    api: path.resolve(__dirname, "./openapi.yaml"), //  Openapi doc file
    handlers
  },
  services: {
    // auto init and bind service, could be access through app.srvs and req.srvs
    redis: {
      initialize: DeeIORedis.init,
      args: {
        port: 6379
      }
    }
  }
}).then(app => {
  app.start();
});
```

Write route handlers

```js
export function hello(req: Request, res: Response, next: NextFunction) {
  const name = req.query.name;
  req.srvs.redis; // access redis service
  res.json(name);
}
```

## Licese

Copyright (c) 2018 sigoden

Licensed under the MIT license.
npm package: @sigodenjs/dee-echo
Description: A echo service for dee framework which mounts data as service.
Author: Sigoden Huang
Latest version: 0.18.0

# Dee Redis Service

A echo service for dee framework which mounts data as service.

## Usage

```ts
import * as DeeEcho from "@sigodenjs/dee-echo";

const data = { k: "v" };
Dee({
  services: {
    echo: {
      initialize: DeeEcho.init<typeof data>,
      args: data
    }
  }
});

srvs.echo.data.k === "v";
```
npm package: @sigodenjs/dee-grpc
Description: A rpc service for dee framework, powered by grpc
Author: Sigoden Huang
Latest version: 0.18.1

# Dee Grpc Service

A rpc service for dee framework, powered by grpc

## Usage

```ts
import * as DeeGrpc from "@sigodenjs/dee-grpc";
import * as grpc from "grpc";

Dee({
  services: {
    rpc: {
      initialize: DeeGrpc.init,
      args: {
        clientProtoFile: CLIENT_RPC_PROTO_FILE,
        serverProtoFile: SERVER_RPC_PROTO_FILE,
        getServerBindOptions: () => {
          return {
            address: '127.0.0.1:4444',
            credentials: grpc.ServerCredentials.createInsecure()
          }
        },
        getClientConstructOptions: serviceName => {
          return {
            address: '127.0.0.1:4444',
            credentials: grpc.credentials.createInsecure()
          }
        },
        serverHandlers: {
          sayHello: async (ctx: DeeGrpc.Context) => {
            await delay(1);
            return { message: ctx.request.name };
          }
        },
      }
    }
  }
});

/**
 * Client call rpc function
 *
 * service App {
 *   // Sends a greeting
 *   rpc SayHello (HelloRequest) returns (HelloReply) {}
 * }
 */
await srvs.rpc.clients.App.call("sayHello", { name });
```
npm package: @sigodenjs/dee-httperr
Description: A service to handle http error for dee framework
Author: Sigoden Huang
Latest version: 0.18.0

# Dee HttpErr Service

A service to handle http error for dee framework

## Usage

```ts
import * as DeeHttpErr from "@sigodenjs/dee-httperr";

Dee({
  services: {
    httperr: {
      initialize: DeeHttpErr.init,
      args: {
        ErrInvalidField: {
          status: 400,
          message: "field ${field} invalid"
        }
      }
    }
  }
});

// throw http error
throw srvs.httperr.ErrInvalidField.toError({ field: "id" });
// return error message
srvs.httperr.ErrInvalidField.resJSON(res, { field: "id" });
```
npm package: @sigodenjs/dee-ioredis
Description: A redis service for dee framework, powered by ioredis
Author: Sigoden Huang
Latest version: 0.18.0

# Dee Redis Service

A redis service for dee framework, powered by ioredis

## Usage

```ts
import * as DeeIORedis from "@sigodenjs/dee-ioredis";

Dee({
  services: {
    redis: {
        initialize: DeeIORedis.init,
        args: {
            port: 6379
        }
    }
  }
})

await srvs.redis.ping()
```
npm package: @sigodenjs/dee-mongoose
Description: A mongo service for dee framework, powered by mongoose
Author: Sigoden Huang
Latest version: 0.18.0

# Dee Mongo Service

A mongo service for dee framework, powered by mongoose

## Usage

```ts
import * as DeeMongoose from "@sigodenjs/dee-mongoose";

Dee({
  services: {
    mongo: {
      initialize: DeeMongoose.init,
      args: {
        uris: "mongodb://localhost:28017/test"
      }
    }
  }
});

await srvs.mongo.connection.db.command({ping: 1});
```
npm package: @sigodenjs/dee-natstream
Description: nat-streaming service for dee framework
Author: sigoden huang
Latest version: 0.1.4
Deprecated: migrate to @sigodenjs/dee-natstreaming

Dee-Natstreaming 框架

## Usage

1. dee 中添加配置项
```js
services: {
    mq: {
        constructor: 'natstream',
        constructorArgs: {
            templatePath: require('./template.json'),
            handlers: require('./handlers')
        }
    }
}
```

2. 编写 template.json
```json
{
  "client": {
    "clusterId": "test-cluster",
    "server": "nats://localhost:4222"
  },
  "producers": {
    "<name>": {
      // fastest-validator validate pubilsh msg
      "schema": {
        "id": { "type": "number", "positive": true, "integer": true },
      }
    }
  },
  "subscribers": {
    "<service.name>": {
      "group": true,
      "durable": true,
      "noAutoAck": true,
      "maxInFlight": 16384,
      "ackWait": 30
    }
  }
}

```

3. 编写 handlers
```js
module.exports = {
      'mysrv.sayHello': function(ctx) {
          ctx.srvs
      }
}
```

4. 发送消息
```js
srvs.mq.send('sayHello', { name: 'abc' }, function(err, cb) {

})
srvs.mq.send('sayHello', { name: 'abc' }).then(function(data) {

})
```
npm package: @sigodenjs/dee-natstreaming
Description: A mq service for dee framework, powered by nats-streaming
Author: Sigoden Huang
Latest version: 0.14.0

# Dee MQ Service

A mq service for dee framework, powered by nats-streaming

## Usage

```ts
import * as DeeNatstreaming from "@sigodenjs/dee-natstreaming";

Dee({
  services: {
    mq: {
      initialize: DeeNatstreaming.init,
      args: {
        client: {
          clusterId: "test-cluster",
          stanOptions: {
            url: "nats://localhost:4222"
          }
        },
        producers: {
          sayHello: {
            schema: {
              name: { type: "string" }
            }
          }
        },
        subscribers: {
          "App.sayHello": {}
        },
        handlers: {
          "App.sayHello": (ctx: DeeNatstreaming.Context) => {
            expect(ctx.srvs).toBeDefined();
            expect(ctx.msg.getData().toString()).toBe('{"name":"tom"}');
          }
        }
      }
    }
  }
});

await srvs.mq.producers.sayHello({ name: "tom" });
```
npm package: @sigodenjs/dee-sequelize
Description: A sql service for dee framework, powered by sequelize
Author: Sigoden Huang
Latest version: 0.18.4

# Dee SQL Service

A sql service for dee framework, powered by sequelize

## Usage

```ts
import * as DeeSequelize from "@sigodenjs/dee-sequelize";

class User extends Model { }

const ModelMap = {
  User: User,
};


Dee({
  services: {
    sql: {
      initialize: DeeSequelize.init,
      args: {
        database: "mysql",
        username: "root",
        password: "mysql",
        models: ModelMap,
        options: {
          port: 3406,
          dialect: "mysql",
          logging: false
        }
      }
    }
  }
});

await srvs.sql.query("select 1", { type: srvs.sql.QueryTypes.SELECT });
```
npm package: @sigodenjs/dee-swaggerize
Description: swagger document driven route builder for dee framework
Author: Sigoden Huang
Latest version: 0.2.6

Dee-swaggerize 

## Usage

```js
var swaggerize = require('@sigodenjs/dee-swaggerize');
var express = require('express');
var bodyParser = require('body-parser');

var app = express();

app.use(bodyParser.json());

swaggerize(app, {
    // swagger 对象或路径
    api: require('./fixtures/defs/pets.json'),
    // 处理器函数，是一个对象，其每个属性对应一个接口操作。
    handlers: require('./handlers'),
    // 安全控制函数，是一个对象，其每个属性对应一个安全验证操作。
    security: require('./security'),
    // 处理解析出的 Route 对象
    routeIteratee: function(route) {
        return route;
    }
});
```
npm package: @sigodenjs/dee-winston
Description: A logger service for dee framework, powered by winston
Author: Sigoden Huang
Latest version: 0.18.3

# Dee Logger Service

A logger service for dee framework, powered by winston

## Usage

```ts
import * as DeeWinston from "@sigodenjs/dee-winston";

Dee({
  services: {
    logger: {
      initialize: DeeWinston.init,
      args: {
        noConsole: true, // 是否打印日志到终端，默认值 fase
        file: { // winston file transport 参考 https://github.com/winstonjs/winston/blob/master/docs/transports.md#file-transport
          filename: "server.log"
        },
        http: { // winston http transport 参考 https://github.com/winstonjs/winston/blob/master/docs/transports.md#http-transport
          host: "http://example.com"
        },
      }
    }
  }
});

await srvs.logger.error(err);
```
npm package: @sigodenjs/fetch-mock
Description: ## 开始使用
Author: sigoden@gmail.com
Latest version: 0.3.0

# 集成 mock 到 fetch 

## 开始使用

- 安装

```
npm i @sigodenjs/mock-fetch
```

- 编写 mock

新建 mock 文件 `./mocks.js`

```js
import mockjs from 'mockjs';

export default {
  // 直接返回数据
  'GET /api/message': { message: "hello" },
  // 使用 mockjs 生成数据
  'PUT /api/name': mockjs.mock({ name: '@name' }),
  // 使用 express handler 
  'POST /api/model/:id':  (req, res) => {
    res.send({ id: req.params.id })
  }
};
```

- 引入

```js
import * as mock from "@sigodnejs/fetch-mock"
import mocks  from from "./mocks"

mock(mocks); // 注入 mock
```

- 结果

```js
const res = await fetch("/api/message")
console.log(await res.json()) // { message: "hello"}
```
npm package: @sigodenjs/fetch-mock-base
Description: Mock http requests made using fetch (or isomorphic-fetch)
Author: Rhys Evans
Latest version: 0.0.6
Deprecated: just deprecated this package

# fetch-mock

Mock http requests made using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch)

![node version](https://img.shields.io/node/v/fetch-mock.svg?style=flat-square)
[![licence](https://img.shields.io/npm/l/fetch-mock.svg?style=flat-square)](https://github.com/wheresrhys/fetch-mock/blob/master/LICENSE)
![npm downloads](https://img.shields.io/npm/dm/fetch-mock.svg?style=flat-square)
[![CircleCI](https://img.shields.io/circleci/project/github/wheresrhys/fetch-mock.svg?style=flat-square)](https://circleci.com/gh/wheresrhys/workflows/fetch-mock)
[![Code coverage](https://img.shields.io/coveralls/github/wheresrhys/fetch-mock.svg?style=flat-square)](https://coveralls.io/github/wheresrhys/fetch-mock)
[![Known Vulnerabilities](https://snyk.io/test/github/wheresrhys/fetch-mock/badge.svg?targetFile=package.json&style=flat-square)](https://snyk.io/test/github/wheresrhys/fetch-mock?targetFile=package.json)

```js
fetchMock.mock('http://example.com', 200);
const res = await fetch('http://example.com');
assert(res.ok);
fetchMock.restore();
```

## Table of Contents

- [Requirements](#requirements)
- [Documentation and Usage](http://www.wheresrhys.co.uk/fetch-mock/)
- [License](#license)
- [Housekeeping](#housekeping)

**I devote a lot of time to maintaining fetch-mock for free. I don't ask for payment, but am raising money for a refugee charity - <a href="https://www.justgiving.com/refugee-support-europe">please consider donating</a>**

---

## Requirements

fetch-mock requires the following to run:

- [Node.js](https://nodejs.org/) 8+ for full feature operation
- [Node.js](https://nodejs.org/) 0.12+ with [limitations](http://www.wheresrhys.co.uk/fetch-mock/#usageinstallation)
- [npm](https://www.npmjs.com/package/npm) (normally comes with Node.js)
- Either of the following
  - [node-fetch](https://www.npmjs.com/package/node-fetch) when testing in a nodejs
  - A browser that supports the `fetch` API when testing in a browser

## Documentation and Usage

See the [project website](http://www.wheresrhys.co.uk/fetch-mock/)

## License

fetch-mock is licensed under the [MIT](https://github.com/wheresrhys/fetch-mock/blob/master/LICENSE) license.
Copyright © 2019, Rhys Evans

## Housekeeping

![npm version](https://img.shields.io/npm/v/fetch-mock.svg?style=flat-square)
[![maintainability](https://api.codeclimate.com/v1/badges/7f8abbf54ec9f3d07df3/maintainability?style=flat-square)](https://codeclimate.com/github/wheresrhys/fetch-mock/maintainability)
npm package: @sigodenjs/fisheye
Description: A opencv fisheye camera model bindings for Node.js
Author: Sigoden Huang
Latest version: 0.1.3

# Fisheye camera model

A opencv fisheye camera model bindings for Node.js.


## Install

**install opencv 3.x**

For linux
```
git clone https://github.com/opencv/opencv
mkdir opencv/build
cd opencv/build
cmake ..
sudo make install
```

For mac
```
brew tap homebrew/science
brew install opencv@3
brew link --force opencv@3
```

**install npm package**

```
npm install @sigodenjs/fisheye
```

## Usage

### Prepare checkboard

Download the [checkerboard pattern](https://github.com/sigoden/node-fisheye/blob/master/doc/checkboard.webp?raw=true) and print it on a paper (letter or A4 size). You also want to attach the paper to a hard, flat surface such as a piece of cardboard. The key here: straight lines need to be straight.

### Take sample photos

Hold the pattern in front of your camera and capture some images. You want to hold the pattern in different positions and angles. The key here: the patterns need to appear distorted in a different ways (so that OpenCV knows as much about your lens as possible). 

![demo](https://raw.githubusercontent.com/sigoden/node-fisheye/master/doc/sample.png) 

### Find K and D

```js
let imgs = fs
    .readdirSync('example/samples')
    .map(file => fs.readFileSync('example/samples/'+file));
let {K, D} = fisheye.calibrate(imgs, 9, 6);
```

### Undistort image

```js
let img = fs.readFileSync('example/samples/IMG-0.jpg');
let buf = fisheye.undistort(img, K, D);
fs.writeFileSync('/tmp/IMG-0.jpg', buf);
```

![before](https://raw.githubusercontent.com/sigoden/node-fisheye/master/example/samples/IMG-0.jpg) --> ![after](https://raw.githubusercontent.com/sigoden/node-fisheye/master/doc/IMG-0.jpg)

## License

Copyright (c) 2018 sigoden

Licensed under the MIT license.
npm package: @sigodenjs/fswebcam
Description: wrap linux tool fswebcam to manipulate cameras
Author: Sigoden Huang
Latest version: 0.1.4

# [fswebcam](https://github.com/sigoden/fswebcamera)

Manupulate uvc cameras on linux (mounted on /dev/video*), powerd by [fswebcam](https://github.com/fsphil/fswebcam).

# Install

### Linux

```
#Linux relies on fswebcam currently
#Tested on ubuntu

sudo apt-get install fswebcam
```

# Usage

### API Usage

``` javascript
//Available in nodejs
var Camera = require( "@sigodenjs/fswebcam" );

//Return type with base 64 image
var opts = {
    callbackReturn: "base64"
};
Camera.capture( "test_picture", opts, function(err, data) {
    var image = "<img src='" + data + "'>";
});


//Get list of cameras
Camera.listDevices( function(err, devices) {
    var anotherCam = new Camera({ device: devices[0] });
});

//Creates webcam instance
var camera = new Camera(opts);

//Will automatically append location output type
camera.capture( "test_picture", function(err, data) {});
```
npm package: @sigodenjs/imagediff
Description: Diff image to check whether objects have changed.
Author: Sigoden Huang
Latest version: 0.1.2

# diff image utils

Diff image to check whether objects have changed.

> Depends on [SSIM](https://en.wikipedia.org/wiki/Structural_similarity) and opencv.

## Install

**install opencv 3.x**

For linux

```
git clone https://github.com/opencv/opencv
mkdir opencv/build
cd opencv/build
cmake ..
sudo make install
```

For mac

```
brew tap homebrew/science
brew install opencv@3
brew link --force opencv@3
```

**install npm package**

```
npm install @sigodenjs/imagediff
```

## Usage

```js
const { diffFactor, diffImage } = require('..');

const img1 = fs.readFileSync("img1.jpg");
const img2 = fs.readFileSync("img2.jpg");
const factor = diffFactor(img1, img2);
const img = diffImage(img1, img2);
fs.writeFileSync("/tmp/imgdiff.jpg", img);
```

| img1                        | img2                        | diff                       | score |
| --------------------------- | --------------------------- | -------------------------- | ----- |
| ![pic1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/pic1.jpg)   | ![pic2](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/pic2.jpg)   | ![pic1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/doc/picdiff.jpg)   | 0.047 |
| ![view1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/view1.jpg) | ![view2](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/view2.jpg) | ![view1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/doc/viewdiff.jpg) | 0     |

## License

Copyright (c) 2018 sigoden

Licensed under the MIT license.
npm package: @sigodenjs/marked-katex-extension
Description: MarkedJS extesion to render katex
Author: sigoden
Latest version: 1.0.0

# marked-katex-extension

Render [katex](https://katex.org/) code in marked

```markdown
This is inline katex: $c = \\pm\\sqrt{a^2 + b^2}$

This is block level katex:

$$
c = \\pm\\sqrt{a^2 + b^2}
$$
```

You will still need to include the css in your html document to allow katex styles.

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css" integrity="sha384-GvrOXuhMATgEsSwCs4smul74iXGOixntILdUW9XmUC6+HX0sLNAK3q71HotJqlAn" crossorigin="anonymous">
```

## Usage

```js
import {marked} from "marked";
import markedKatex from "@sigodenjs/marked-katex-extension";

// or in the browser
// <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@{version}/dist/katex.min.css">
// <script defer src="https://cdn.jsdelivr.net/npm/katex@{version}/dist/katex.min.js"></script>
// <script src="https://cdn.jsdelivr.net/npm/marked@{version}/lib/marked.umd.js"></script>
// <script src="https://cdn.jsdelivr.net/npm/@sigodenjs/marked-katex-extension@{version}/lib/index.umd.js"></script>

const options = {
  throwOnError: false,
  inlineTolerantNoSpace: true,
};

marked.use(markedKatex(options));

marked.parse("katex: $c = \\pm\\sqrt{a^2 + b^2}$");
```

![image](https://github.com/user-attachments/assets/a24c3c3b-3085-463d-ad12-ed6e92c30e3c)
npm package: @sigodenjs/name
Description: A utility class to convert a string into CamelCase/dash-case/snake_case, capitalized/uncapitalized, plural/singular name.
Author: Sigoden Huang
Latest version: 1.0.2

# name

A utility class to convert a string into CamelCase/dash-case/snake_case, capitalized/uncapitalized, plural/singular name.

## install

```sh
npm i @sigodenjs/name -s
```

## Usage

```js
var Name = require('@sigodenjs/name');
var name = new Name('helloWorld');

name.toDashCase().toValue(); // returns hello-world
name.toDashCase().toCamelCase().toValue() === name.toValue(); // true
name.toCapital().toUncapital().toValue() === name.toValue();  // true
name.toPlural().toSingular().toValue() === name.toValue(); // true
```

## API

### static methods

#### capitalize()
```js
Name.capitalize('apple'); // returns Apple
```

#### uncapitalize()
```js
Name.uncapitalize('Apple');  // returns apple
```

#### toDashCase()
```js
Name.toDashCase('helloWorld'); // returns hello-world
```

#### toSnakeCase()
```js
Name.toSnakeCase('helloWorld'); // returns hello_world
```

#### toCamelCase()
```js
Name.toCamelCase('hello-world'); // returns helloWorld
```

#### pluralize()
```js
Name.pluralize('apple'); // returns apples
```

#### singularize()
```js
Name.singularize('apples'); // returns apple
```

### public methods

#### toValue()
```js
new Name('hello-world').toValue(); // returns hello-world
```

#### toPlural()
```js
new Name('apple').toPlural().toValue(); // returns apples;
```

#### toSingular()
```js
new Name('apples').toSingular().toValue(); // returns apple;
```

#### toCapital()
```js
new Name('apple').toCapital().toValue(); // returns Apple;
```

#### toCapitalWords()
```js
new Name('hello-world').toCapitalWords().toValue(); // returns Hello-World;
```

#### toUncapital()
```js
new Name('Apple').toUncapital().toValue(); // returns apple;
```

#### toDashCase()
```js
new Name('helloWorld').toDashCase().toValue(); //returns hello-world
```

#### toSnakeCase()
```js
new Name('helloWorld').toDashCase().toValue(); //returns hello_world
```

#### toCamelCase()
```js
new Name('hello-world').toCamelCase().toValue(); //returns helloWorld
```

## License

[MIT](LICENSE)
npm package: @sigodenjs/openapize
Description: Mount rest api depends on OpenAPI doc file for express app.
Author: Sigoden Huang
Latest version: 0.1.14

# Openapize

Mount rest api depends on OpenAPI doc file for express app.

## Getting started

```js
const openapize = require("@sigodenjs/openapize");
const express = require("express");
const bodyParser = require("body-parser");

const app = express();

app.use(bodyParser.json());

openapize(app, {
  // openapi file
  api: require("./fixtures/defs/pets.json"),
  // handler funcs
  handlers: require("./handlers"),
  // security middleware funcs
  security: require("./security"),
  // hook to modify api
  mapAPI: function(api) {
    return api;
  },
  // no handler for api
  noHandlerAPI: function(api) {

  }
});
```

## Limit

- `ParameterObject` does not support `content`
- `RequestBodyObject.content` has at most one `MeidaObject`
- `OperationObject.security` has at most one `securitySchemes`

## Licese

Copyright (c) 2018 sigoden

Licensed under the MIT license.
npm package: @sigsentry/core
Description: SigSentry core SDK — TypeScript API client, types, and utilities for AI-powered log analysis
Latest version: 0.1.0

# @sigsentry/core

TypeScript API client and shared types for [SigSentry](https://sigsentry.dev) — AI-powered log analysis.

## Installation

```bash
npm install @sigsentry/core
```

## Quick Start

```typescript
import { SigSentryClient } from '@sigsentry/core';

const client = new SigSentryClient({
  apiKey: 'your-api-key',
});

// Create an analysis
const result = await client.createAnalysis({
  description: 'Users getting 500 errors on checkout',
  timeStart: new Date('2024-01-15T10:00:00Z'),
  timeEnd: new Date('2024-01-15T11:00:00Z'),
});

// Stream results in real-time
await client.createAnalysis(input, {
  onStatus: (stage) => console.log(`Stage: ${stage}`),
  onPartial: (partial) => console.log(`Severity: ${partial.severity}`),
  onComplete: (id, result) => console.log(`Done: ${result.summary}`),
});
```

## What's Included

- **SigSentryClient** — Framework-agnostic API client with SSE streaming
- **TypeScript types** — AnalysisResult, AnalysisInput, ApiResponse, and more
- **Result<T, E>** — Type-safe error handling without exceptions
- **ErrorCode** — Standardized error codes

## For React

See [@sigsentry/react](https://www.npmjs.com/package/@sigsentry/react) for drop-in React components.

## License

MIT
npm package: @sigsentry/react
Description: SigSentry React SDK — drop-in components for AI-powered log analysis
Latest version: 0.1.0

# @sigsentry/react

Drop-in React components for [SigSentry](https://sigsentry.dev) — AI-powered log analysis.

## Installation

```bash
npm install @sigsentry/react
```

## Quick Start

```tsx
import { SigSentryProvider, AnalysisWidget } from '@sigsentry/react';

function App() {
  return (
    <SigSentryProvider apiKey="your-api-key" theme="light">
      <AnalysisWidget
        onAnalysisComplete={(result) => console.log(result)}
        defaultTimeRange="1h"
      />
    </SigSentryProvider>
  );
}
```

## Components

### `<SigSentryProvider>`

Context provider that initializes the API client.

```tsx
<SigSentryProvider
  apiKey="your-api-key"
  baseUrl="https://api.sigsentry.dev"  // optional
  theme="light"                         // 'light' | 'dark' | 'auto'
>
  {children}
</SigSentryProvider>
```

### `<AnalysisWidget>`

Full-featured analysis form with streaming results.

```tsx
<AnalysisWidget
  onAnalysisComplete={(result) => {}}
  onError={(error) => {}}
  defaultTimeRange="1h"    // '15m' | '30m' | '1h' | '4h' | '12h' | '24h'
  showFollowUp={true}
  className="my-widget"
/>
```

### `<AnalysisResultDisplay>`

Read-only result renderer. Use when you build your own input form.

```tsx
<AnalysisResultDisplay result={analysisResult} />
```

### `<SigSentryTrigger>`

Button that opens the widget in a modal or slideout panel.

```tsx
<SigSentryTrigger mode="modal" label="Diagnose Error" />
```

### `useSigSentry()` Hook

Headless hook for full control over the analysis flow.

```tsx
const {
  submitAnalysis,
  askFollowUp,
  submitFeedback,
  status,     // 'idle' | AnalysisStage
  result,     // AnalysisResult | null
  error,      // ApiError | null
  isLoading,
} = useSigSentry();
```

## Theming

Customize with CSS custom properties:

```css
:root {
  --sg-color-primary: #6366f1;
  --sg-color-bg: #ffffff;
  --sg-color-text: #111827;
  --sg-font-family: 'Inter', sans-serif;
  --sg-border-radius: 8px;
}
```

## License

MIT
npm package: @sigsign/hn-search
Description: A JavaScript client to search Hacker News content using the hn.algolia.com API.
Author: Sigsign
Latest version: 0.3.0

# hn-search

A JavaScript client to search Hacker News content using the hn.algolia.com API.

## Install

```bash
npm install @sigsign/hn-search
```

## Usage

```typescript
import { hnSearch } from "@sigsign/hn-search";

const result = await hnSearch({
  query: "example",
  tags: ["story"],
  sort: "date",
  filters: [
    ["points", ">", 100],
  ],
});
```

## Author

- Sigsign <<sig@signote.cc>>

## License

MIT