open-index/open-npm huggingface dataset:
npm package: @newsmcp/openclaw
Description: OpenClaw plugin for real-time AI-clustered world news — topic and geographic filtering from newsmcp.io. Free, no API key.
Author: pranciskus
Latest version: 1.1.1

# @newsmcp/openclaw

[![npm version](https://img.shields.io/npm/v/@newsmcp/openclaw)](https://www.npmjs.com/package/@newsmcp/openclaw)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

OpenClaw plugin for real-time AI-clustered world news. Topic and geographic filtering from [newsmcp.io](https://newsmcp.io). Free, no API key.

## Install

```bash
openclaw plugins install @newsmcp/openclaw
```

## Configuration

Optional — works out of the box with no configuration.

To use a custom API endpoint:

```bash
openclaw config set plugins.entries.@newsmcp/openclaw.config.apiBaseUrl "https://your-api.example.com/v1"
```

Or edit `openclaw.json`:

```json
{
  "plugins": {
    "entries": {
      "@newsmcp/openclaw": {
        "config": {
          "apiBaseUrl": "https://newsmcp.io/v1"
        }
      }
    }
  }
}
```

## Tools

| Tool | Description | Key Parameters |
|------|-------------|----------------|
| `newsmcp_get_news` | Top events with topic/geo/time filtering | `topics`, `geo`, `hours`, `page`, `per_page`, `order_by` |
| `newsmcp_get_news_detail` | Full event detail with context and all sources | `event_id` |
| `newsmcp_get_topics` | List available topic categories | — |
| `newsmcp_get_regions` | List available geographic regions | — |

## License

MIT
npm package: @newsmcp/server
Description: World news for AI agents — MCP server with real-time AI-clustered events, topic classification, geographic filtering. Free, no API key.
Author: pranciskus
Latest version: 1.1.1

# @newsmcp/server

World news for AI agents. Real-time events clustered by AI from hundreds of sources, classified by topic and geography, ranked by importance.

Free. No API key. One command.

```
npx -y @newsmcp/server
```

**Website**: [newsmcp.io](https://newsmcp.io)
**Full docs**: [github.com/pranciskus/newsmcp](https://github.com/pranciskus/newsmcp)

## Install

**Claude Desktop** — add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "newsmcp": {
      "command": "npx",
      "args": ["-y", "@newsmcp/server"]
    }
  }
}
```

**Claude Code**: `claude mcp add newsmcp -- npx -y @newsmcp/server`

**Cursor** — add to `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "newsmcp": {
      "command": "npx",
      "args": ["-y", "@newsmcp/server"]
    }
  }
}
```

## Tools

| Tool | Description |
|------|-------------|
| `get_news` | Top events with topic/geo/time filtering |
| `get_news_detail` | Full event detail with context and all sources |
| `get_topics` | Available topic categories |
| `get_regions` | Available geographic regions (100+) |

## REST API

Same data without MCP. Base URL: `https://newsmcp.io/v1`

```bash
curl -s https://newsmcp.io/v1/news/ | jq
curl -s "https://newsmcp.io/v1/news/?topics=technology&geo=europe" | jq
curl -s https://newsmcp.io/v1/news/topics/ | jq
```

## License

MIT
npm package: @newsoftglobal/buildos-sync
Description: Merge per-module *.buildos.yaml API specs and sync to BuildOS platform
Author: NewSoft Global
Latest version: 2.0.0

# @newsoftglobal/buildos-sync

Merge per-module `*.buildos.yaml` API specs and sync to BuildOS. Extends OpenAPI 3.0 with custom fields for service dependencies and sequence diagrams.

## Install

```bash
npm install @newsoftglobal/buildos-sync
```

## Quick Start

### 1. Create `*.buildos.yaml` per module

```yaml
# src/modules/tasks/task.buildos.yaml
paths:
  /api/tasks:
    post:
      summary: Create Task
      tags: [Tasks]
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required: [title]
              properties:
                title:
                  type: string
                  example: Fix login bug
      responses:
        201:
          description: Task created
      x-dependencies:
        - service: TaskService.create
        - model: Task
      x-sequence: |
        Client -> API: POST /api/tasks { title }
        API -> TaskService: create(data)
        TaskService -> MongoDB: insert(data)
        MongoDB --> TaskService: task
        API --> Client: 201 Created
```

### 2. Add sync key to `.env`

```env
BUILDOS_SYNC_KEY=bos_sk_xxxxxxxx
```

### 3. Run

```bash
npx buildos-sync all
```

## Custom Extensions

| Field | Description |
|-------|-------------|
| `x-dependencies` | Array of `{ service, model, queue, cache }` |
| `x-sequence` | Mermaid-compatible sequence diagram text |

## CLI Commands

| Command | Description |
|---------|-------------|
| `buildos-sync generate` | Validate & merge `*.buildos.yaml` → `openapi.json` |
| `buildos-sync push` | Push to BuildOS |
| `buildos-sync all` | Generate + push |

## License

MIT
npm package: @newsoftglobal/feedbackkit-jquery
Description: FeedbackKit jQuery SDK — Collect user feedback with screenshots, comments, and tracking
Author: NewSoft Global
Latest version: 1.0.1

# @newsoftglobal/feedbackkit-jquery

jQuery SDK for [FeedbackKit](https://feedbackkit.dev) — requires jQuery 3+.

## Installation

### Via CDN

```html
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://unpkg.com/@newsoftglobal/feedbackkit-jquery/dist/feedbackkit-jquery.min.js"></script>
```

### Via npm

```bash
npm install @newsoftglobal/feedbackkit-jquery
```

## Usage

```html
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<!-- Optional: for real screenshot capture -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<!-- FeedbackKit -->
<script src="https://unpkg.com/@newsoftglobal/feedbackkit-jquery/dist/feedbackkit-jquery.min.js"></script>

<script>
  $(function () {
    // Initialize
    $.feedbackKit({ apiKey: 'your-api-key' });

    // After user login
    $.feedbackKit('setUser', {
      id: 'user-123',
      email: 'user@example.com',
      name: 'John Doe'
    });

    // On logout
    $.feedbackKit('clearUser');
  });
</script>
```

### Initialize with user

```js
$.feedbackKit({
  apiKey: 'your-api-key',
  user: {
    id: 'user-123',
    email: 'user@example.com',
    name: 'John'
  }
});
```

## API

| Method | Description |
|--------|-------------|
| `$.feedbackKit({ apiKey })` | Initialize the widget |
| `$.feedbackKit('setUser', { id, email, name })` | Set user identity |
| `$.feedbackKit('clearUser')` | Clear user identity |
| `$.feedbackKit('destroy')` | Remove widget from page |

## Features

- 🎯 Floating feedback button
- 📸 Area screenshot capture
- 📝 Feedback form (bug, feature, improvement, other)
- 📋 User feedback history
- 💬 Comment thread with admin replies
- 👤 User identification
- 🎨 Dark theme UI
- ⚡ jQuery plugin pattern
npm package: @newsoftglobal/feedbackkit-js
Description: FeedbackKit Vanilla JS SDK — Collect user feedback with screenshots, comments, and tracking
Author: NewSoft Global
Latest version: 1.0.6

# @newsoftglobal/feedbackkit-js

Vanilla JavaScript SDK for [FeedbackKit](https://feedbackkit.dev) — zero dependencies.

## Installation

### Via CDN (recommended)

```html
<script src="https://unpkg.com/@newsoftglobal/feedbackkit-js/dist/feedbackkit.min.js"></script>
```

### Via npm

```bash
npm install @newsoftglobal/feedbackkit-js
```

## Usage

### CDN / Script Tag

```html
<script src="https://unpkg.com/@newsoftglobal/feedbackkit-js/dist/feedbackkit.min.js"></script>
<script>
  FeedbackKit.init({
    apiKey: 'your-api-key'
  });
</script>
```

### With User Identity

```html
<script>
  FeedbackKit.init({ apiKey: 'your-api-key' });

  // After user logs in
  FeedbackKit.setUser({
    id: 'user-123',
    email: 'user@example.com',
    name: 'John Doe'
  });

  // On logout
  FeedbackKit.clearUser();
</script>
```

### Screenshot Support

For real screenshot capture, include [html2canvas](https://html2canvas.hertzen.com):

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<script src="https://unpkg.com/@newsoftglobal/feedbackkit-js/dist/feedbackkit.min.js"></script>
```

## API

| Method | Description |
|--------|-------------|
| `FeedbackKit.init({ apiKey })` | Initialize the widget |
| `FeedbackKit.setUser({ id, email, name })` | Set user identity |
| `FeedbackKit.clearUser()` | Clear user identity |
| `FeedbackKit.destroy()` | Remove widget from page |

## Features

- 🎯 Floating feedback button
- 📸 Area screenshot capture
- 📝 Feedback form (bug, feature, improvement, other)
- 📋 User feedback history
- 💬 Comment thread with admin replies
- 👤 User identification
- 🎨 Dark theme UI
- 📦 Zero dependencies
- ⚡ Single `<script>` tag setup
npm package: @newsoftglobal/feedbackkit-nuxt
Description: FeedbackKit Nuxt 3 Module - Collect user feedback with screenshots, comments, and tracking
Author: NewSoft Global
Latest version: 1.0.0

# @newsoftglobal/feedbackkit-nuxt

FeedbackKit module for **Nuxt 3** — collect user feedback with screenshots, comments, and tracking.

> This module wraps [`@newsoftglobal/feedbackkit-vue`](https://www.npmjs.com/package/@newsoftglobal/feedbackkit-vue) for seamless Nuxt integration with auto-imports and SSR compatibility.

## Installation

```bash
npm install @newsoftglobal/feedbackkit-nuxt
```

## Setup

Add the module to your `nuxt.config.ts`:

```ts
export default defineNuxtConfig({
  modules: ['@newsoftglobal/feedbackkit-nuxt'],

  feedbackKit: {
    apiKey: 'your-api-key'
  }
})
```

That's it! The `<FeedbackWidget />` component and `useFeedbackKit()` composable are auto-imported.

## Usage

### Feedback Widget

Drop the widget into any page or layout:

```vue
<template>
  <div>
    <h1>My App</h1>
    <FeedbackWidget />
  </div>
</template>
```

### User Identification

Use the `useFeedbackKit()` composable to link feedback to authenticated users:

```vue
<script setup>
const { setUser, clearUser, hasUser } = useFeedbackKit()

// After user logs in
setUser({
  id: 'user-123',
  email: 'user@example.com',
  name: 'John Doe'
})

// On logout
clearUser()
</script>
```

### Environment Variables

You can also use environment variables instead of hardcoding your API key:

```ts
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@newsoftglobal/feedbackkit-nuxt'],

  feedbackKit: {
    apiKey: process.env.FEEDBACKKIT_API_KEY
  }
})
```

## API

### Module Options

| Option   | Type     | Required | Description          |
| -------- | -------- | -------- | -------------------- |
| `apiKey` | `string` | ✅       | Your FeedbackKit API key |

### `useFeedbackKit()` Composable

| Method/Property | Type       | Description                        |
| --------------- | ---------- | ---------------------------------- |
| `setUser()`     | `Function` | Set user info `{ id, email, name }` |
| `clearUser()`   | `Function` | Clear current user                 |
| `user`          | `Object`   | Reactive user state                |
| `hasUser`       | `boolean`  | Whether a user is currently set    |

## Publishing

```bash
cd nuxtplugin
npm run prepack    # Builds the module
npm publish --access public
```

## License

MIT
npm package: @newsoftglobal/feedbackkit-reactnative
Description: FeedbackKit React Native SDK - Collect user feedback with screenshots, comments, and tracking. Works with Expo.
Author: NewSoft Global
Latest version: 1.0.0

# @newsoftglobal/feedbackkit-reactnative

FeedbackKit SDK for **React Native** — collect user feedback with screenshots, comments, and tracking.

> Works with both **Expo** and **bare React Native** projects. No native modules required.

## Installation

```bash
npm install @newsoftglobal/feedbackkit-reactnative react-native-view-shot
```

For **Expo** projects:
```bash
npx expo install @newsoftglobal/feedbackkit-reactnative react-native-view-shot
```

## Quick Start

### 1. Wrap your app with the Provider

```jsx
import { FeedbackKitProvider, FeedbackWidget } from '@newsoftglobal/feedbackkit-reactnative';
import ViewShot from 'react-native-view-shot';

export default function App() {
  const viewRef = useRef();

  return (
    <FeedbackKitProvider apiKey="your-api-key">
      <ViewShot ref={viewRef} style={{ flex: 1 }}>
        {/* Your app content */}
        <HomeScreen />
      </ViewShot>
      <FeedbackWidget viewShotRef={viewRef} />
    </FeedbackKitProvider>
  );
}
```

### 2. (Without screenshot support)

```jsx
<FeedbackKitProvider apiKey="your-api-key">
  <App />
  <FeedbackWidget />
</FeedbackKitProvider>
```

### 3. User identification

```jsx
import { useFeedbackKit } from '@newsoftglobal/feedbackkit-reactnative';

function ProfileScreen() {
  const { setUser, clearUser, hasUser } = useFeedbackKit();

  const onLogin = (user) => {
    setUser({
      id: user.uid,
      email: user.email,
      name: user.displayName
    });
  };

  const onLogout = () => {
    clearUser();
  };

  // ...
}
```

## API Reference

### `<FeedbackKitProvider>`

| Prop     | Type     | Required | Description          |
| -------- | -------- | -------- | -------------------- |
| `apiKey` | `string` | ✅       | Your FeedbackKit API key |

### `<FeedbackWidget>`

| Prop           | Type  | Required | Description                                |
| -------------- | ----- | -------- | ------------------------------------------ |
| `viewShotRef`  | `ref` | ❌       | Ref to a `<ViewShot>` component for screenshots |

### `useFeedbackKit()` Hook

| Return         | Type       | Description                        |
| -------------- | ---------- | ---------------------------------- |
| `setUser()`    | `Function` | Set user info `{ id, email, name }` |
| `clearUser()`  | `Function` | Clear current user                 |
| `user`         | `Object`   | Current user state                 |
| `hasUser`      | `boolean`  | Whether a user is currently set    |

## Features

- 🎨 **Beautiful dark UI** matching the FeedbackKit design system
- 📸 **Screenshot capture** via `react-native-view-shot`
- 📝 **Feedback form** with type selection (Bug, Feature, Improve, Other)
- 📋 **My Feedbacks** list with status tracking
- 💬 **Comment thread** for two-way communication
- 👤 **User identification** for linking feedback to users
- 📱 **Works with Expo** — no ejecting required
 
## License

MIT
npm package: @newsoftware/table
Description: SDK for New Software table operations
Author: Jian Liao
Latest version: 1.1.0

# @newsoftware/table

This package provides a simple SDK for New Software table operations.

## Installation

```bash
npm install @newsoftware/table
```

## Requirements

This package requires Node.js version 18.0.0 or later.

## Usage

```typescript
import { Table } from '@newsoftware/table';

const table = new Table('your-api-key');

// Update a table
table.updateTable('table-id', 'Table Name', headers, data)
  .then(result => console.log(result))
  .catch(error => console.error(error));

// Insert data (automatically chunks data)
table.insertData('table-id', data)
  .then(result => console.log(result))
  .catch(error => console.error(error));

// Get table data
table.getTable('table-id')
  .then(result => console.log(result))
  .catch(error => console.error(error));

// Delete a table
table.deleteTable('table-id')
  .then(result => console.log(result))
  .catch(error => console.error(error));
```

## License

MIT
npm package: @newsriver/eliza-plugin
Description: ElizaOS plugin for the NewsRiver Global Intelligence API. 8 actions: intelligence briefings, semantic search, articles, trends, AskRiver AI chat, email/SMS/scrape proxies. Supports x402 micropayments and API key auth.
Author: NewsRiver
Latest version: 2.1.0

# @newsriver/eliza-plugin

The official ElizaOS plugin for the **NewsRiver Global Intelligence API**.

Connects your Eliza agent to NewsRiver's global news intelligence platform — 277+ sources across 137 countries, AI-generated briefings, semantic vector search, and secure Web2 proxies (email, SMS, scraping).

## Installation

```bash
npm install @newsriver/eliza-plugin
```

## Authentication

### Option 1: API Key (Subscription)
Get an API key from [NewsRiver](https://agent.yieldcircle.app/#pricing) and add it to your `.env`:
```env
NEWSRIVER_API_KEY=nrk_live_your_key_here
```
> **Security:** Keys are SHA-256 hashed server-side. Never stored in plaintext. Analytics logs mask keys to last 4 chars only.

### Option 2: x402 Micropayments (No API Key)
If your Eliza agent has a wallet on Base network, it can handle `HTTP 402` responses and pay per-request in USDC. Requires `@x402/core`.

> ⚠️ **Spending Safety:** Use a limited allowance contract (e.g., PaySponge) to cap spending. Never give the agent full wallet access.

## Usage

```typescript
import { newsRiverPlugin } from "@newsriver/eliza-plugin";

const myAgent = {
  name: "CryptoTraderBot",
  plugins: [newsRiverPlugin]
};
```

## Actions (7)

| Action | Cost | Description |
|---|---|---|
| `GET_NEWSRIVER_INTELLIGENCE` | $0.02–$0.10 | Fetch AI intelligence briefings (hourly=$0.02, daily/weekly/monthly=$0.10) |
| `SEARCH_NEWSRIVER` | $0.001 | Semantic vector search across all articles |
| `GET_NEWSRIVER_ARTICLES` | $0.001 | Fetch latest news articles |
| `GET_NEWSRIVER_TRENDS` | $0.001 | Sentiment trend timelines for any topic |
| `NEWSRIVER_SEND_EMAIL` | $0.05 | Send email via proxy (50/hr limit) |
| `NEWSRIVER_SEND_SMS` | $0.25 | Send SMS via proxy (10/hr limit) |
| `NEWSRIVER_SCRAPE` | $0.10 | Scrape public webpages (SSRF-protected) |

### ⚠️ Outbound Proxy Actions
`NEWSRIVER_SEND_EMAIL` and `NEWSRIVER_SEND_SMS` send **real** messages. The agent should always confirm with the user before executing these actions. The API enforces:
- Hardcoded sender identity (`agents@yieldcircle.app`)
- Rate limits per IP and per wallet
- SMS messages prefixed with `[NewsRiver Agent]`

## Testing with Dry-Run

Test any action for free using the `X-Dry-Run: true` header. Returns mock data labeled `[SAMPLE]`:
```bash
curl -H "X-Dry-Run: true" https://api.yieldcircle.app/api/v1/articles
```

## Links

- **API Docs:** https://agent.yieldcircle.app/#docs
- **Pricing:** https://agent.yieldcircle.app/#pricing
- **Support:** support@yieldcircle.app
npm package: @newstackdev/iosdk-newgraph-client-js
Description: JS/TS variant of Newgraph Client - Part of iOSDK by the Newcoin Foundation
Author: Igor Rubinovich
Latest version: 1.9.97

## Newgraph API Client

[See here for more info and documentation](https://www.newcoin.org/docs).

## Install

`npm i --save @newstackdev/iosdk-newgraph-client-js`

## Keys
A temporary solution is to use the client token from the browser:

0. sign up (duh)
1. sign in to your newcoin os account
2. open developer tools (cmd/ctrl + shift + i)
3. navigate to developer tools -> local storage -> newsafe-auth-token

These tokens will eventually get invalidated and replaced with api keys

## Getting started
```
const newgraph = new NewgraphApi({
        baseUrl: API_URL,
        securityWorker: (securityData: { token: string } | null) => {
          return !securityData ? {} : { headers: { Authorization: securityData.token } };
        },
      });
    

newgraph.setSecurityData({ token });
```

## Reference
[API (Wip)](https://github.com/newstackdev/iosdk-newgraph-client-js/blob/main/api.md)

## Examples
See [examples](https://github.com/newstackdev/iosdk-newgraph-client-js/tree/main/examples). To be continued.

## Why folders are called moods?
It's a technical term. We call them folders in all other contexts.

## More information
Navigate to [Newcoin Docs](https://www.newcoin.org/docs)


## License
MIT
npm package: @newsteam/assemble-cli
Description: Newsteam command line tools
Author: News Team
Latest version: 0.0.0

# @newsteam/cli

[![License](https://img.shields.io/npm/l/@newsteam/cli.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/cli/latest.svg)](https://www.npmjs.com/package/@newsteam/cli)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/cli.svg)](https://www.npmjs.com/package/@newsteam/cli)
[![Dependencies](https://img.shields.io/david/feight/newsteam.svg?path=packages%2Fcli)](https://david-dm.org/feight/newsteam?path=packages/cli)
[![DevDependencies](https://img.shields.io/david/feight/newsteam.svg?path=packages%2Fcli)](https://david-dm.org/feight/newsteam?type=dev&path=packages/cli)
npm package: @newsteam/babel
Description: Collection of babel dependencies
Author: News Team
Latest version: 0.0.53

# @newsteam/babel

[![License](https://img.shields.io/npm/l/@newsteam/babel.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/babel/latest.svg)](https://www.npmjs.com/package/@newsteam/babel)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/babel.svg)](https://www.npmjs.com/package/@newsteam/babel)

This package provides a set of dependencies that can be used to run babel with @newsteam/babel-preset without having to do the manual peer dependency install step required if you
install @newsteam/babel-preset directly.

## Usage

### Installation

1. Install the package:

  ```sh
  npm install --save-dev @newsteam/babel
  ```
npm package: @newsteam/babel-preset
Description: Shared preset for babel
Author: News Team
Latest version: 0.0.57

# @newsteam/babel-preset

[![License](https://img.shields.io/npm/l/@newsteam/babel-preset.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/babel-preset/latest.svg)](https://www.npmjs.com/package/@newsteam/babel-preset)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/babel-preset.svg)](https://www.npmjs.com/package/@newsteam/babel-preset)

This package provides a preset for babel.

## Usage

A single babel preset is exported.

Our default export contains all of our babel plugins and presets. It requires the following peer dependencies:

```
    @babel/core
```

### Installation

1. Install the shared configuration:

  ```sh
  npm install --save-dev @newsteam/babel-preset
  ```

2. Install the shared configuration peer dependencies (npm 5+):

  ```sh
  npx install-peerdeps --dev @newsteam/babel-preset
  ```

3. Add `"@newsteam/babel-preset"` or your `"presets"` array in to your .babelrc.

## Configuration

### targets

#### `string | Array<string> | { [string]: string }, defaults to {}.`

Describes the environments you support/target for your project.

This can either be a browserslist-compatible query:

```
{
  "targets": "> 0.25%, not dead"
}
```

Or an object of minimum environment versions to support:

```
{
  "targets": {
    "chrome": "58",
    "ie": "11"
  }
}
```

Example environments: chrome, opera, edge, firefox, safari, ie, ios, android, node, electron.

Sidenote, this uses @babel/preset-env under the hood, so if no targets are specified it will transform all ECMAScript 2015+ code by default.


### addModuleExports

#### `boolean, defaults to false.`

Enables the export default module.exports that was turned off in Babel 6.


### debug

#### `boolean, defaults to false.`

Outputs the targets/plugins used and the version specified in plugin data version to console.log.


### development

#### `boolean, defaults to false.`

Toggles plugins that aid in development, such as @babel/plugin-transform-react-jsx-self and
@babel/plugin-transform-react-jsx-source.


## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/cli-notify
Description: This package provides a notification function used to signal completion of cli tasks.
Author: News Team
Latest version: 0.0.13

# @newsteam/cli-notify

[![License](https://img.shields.io/npm/l/@newsteam/cli-notify.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/cli-notify/latest.svg)](https://www.npmjs.com/package/@newsteam/cli-notify)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/cli-notify.svg)](https://www.npmjs.com/package/@newsteam/cli-notify)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?path=cli-notify)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?type=dev&path=cli-notify)

This package provides a notification function used to signal completion of cli tasks.

## Install

```
$ npm install @newsteam/cli-notify
```
## Simple usage

```js
import { notify } from "@newsteam/cli-notify";

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/cli-tasks
Description: This package provides a collection of cli tasks.
Author: News Team
Latest version: 0.0.45

# @newsteam/cli-tasks

[![License](https://img.shields.io/npm/l/@newsteam/cli-tasks.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/cli-tasks/latest.svg)](https://www.npmjs.com/package/@newsteam/cli-tasks)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/cli-tasks.svg)](https://www.npmjs.com/package/@newsteam/cli-tasks)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Ftasks)](https://david-dm.org/feight/packages?path=tasks)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Ftasks)](https://david-dm.org/feight/packages?type=dev&path=tasks)

This package provides a set of cli tasks.

## Install

```
$ npm install @newsteam/tasks
```
## Simple usage

```js
import { task } from "@newsteam/cli-tasks";

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/cli-utils
Description: This package provides a collection of cli utils.
Author: News Team
Latest version: 0.0.17

# @newsteam/cli-utils

[![License](https://img.shields.io/npm/l/@newsteam/cli-utils.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/cli-utils/latest.svg)](https://www.npmjs.com/package/@newsteam/cli-utils)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/cli-utils.svg)](https://www.npmjs.com/package/@newsteam/cli-utils)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?path=cli-utils)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?type=dev&path=cli-utils)

This package provides a collection of cli utils.

## Install

```
$ npm install @newsteam/cli-utils
```
## Simple usage

```js
import { util } from "@newsteam/cli-utils";

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/eslint
Description: Collection of eslint dependencies
Author: News Team
Latest version: 0.0.238

# @newsteam/eslint

[![License](https://img.shields.io/npm/l/@newsteam/eslint.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/eslint/latest.svg)](https://www.npmjs.com/package/@newsteam/eslint)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/eslint.svg)](https://www.npmjs.com/package/@newsteam/eslint)

This package provides a set of dependencies that can be used to run eslint with @newsteam/eslint-config without having to do the manual peer dependency install step required if you
install @newsteam/eslint-config directly.

## Usage

### Installation

1. Install the package:

```sh
npm install --save-dev @newsteam/eslint
```

2. Add `"extends": "@newsteam"` to your .eslintrc.
npm package: @newsteam/imagemin
Description: Preconfigured imagemin function
Author: News Team
Latest version: 0.0.33

# @newsteam/imagemin

[![License](https://img.shields.io/npm/l/@newsteam/imagemin.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/imagemin/latest.svg)](https://www.npmjs.com/package/@newsteam/imagemin)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/imagemin.svg)](https://www.npmjs.com/package/@newsteam/imagemin)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=imagemin)](https://david-dm.org/feight/packages?path=imagemin)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=imagemin)](https://david-dm.org/feight/packages?type=dev&path=imagemin)

This package provides a shared config for imagemin and several of its plugins.

## Install

```
$ npm install imagemin
```
## Usage

```js
import imagemin from "@newsteam/imagemin";

(async () => {

  const files = await imagemin(['images/*.{jpg,png}'], 'build/images');

  console.log(files);
  //=> [{data: <Buffer 89 50 4e ...>, path: 'build/images/foo.jpg'}, ...]

})();
```

## API

### imagemin(input, [output], [options])

Returns `Promise<Object[]>` in the format `{data: Buffer, path: string}`.

#### input

Type: `string[]`

Files to be optimized. See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).

#### output

Type: `string`

## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/jasmine
Description: Collection of jasmine dependencies
Author: News Team
Latest version: 0.0.45

# @newsteam/eslint

[![License](https://img.shields.io/npm/l/@newsteam/jasmine.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/jasmine/latest.svg)](https://www.npmjs.com/package/@newsteam/jasmine)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/jasmine.svg)](https://www.npmjs.com/package/@newsteam/jasmine)

This package provides a set of dependencies that can be used to run jasmine.

## Usage

### Installation

1. Install the package:

```sh
npm install --save-dev @newsteam/jasmine
```
npm package: @newsteam/legacy-cli
Description: Newsteam command line tools
Author: News Team
Latest version: 0.0.87

# @newsteam/legacy-cli

[![License](https://img.shields.io/npm/l/@newsteam/legacy-cli.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/legacy-cli/latest.svg)](https://www.npmjs.com/package/@newsteam/legacy-cli)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/legacy-cli.svg)](https://www.npmjs.com/package/@newsteam/legacy-cli)
[![Dependencies](https://img.shields.io/david/feight/newsteam.svg?path=packages%2Fcli)](https://david-dm.org/feight/newsteam?path=legacy-cli))
[![DevDependencies](https://img.shields.io/david/feight/newsteam.svg?path=packages%2Fcli)](https://david-dm.org/feight/newsteam?type=dev&path=legacy-cli)
npm package: @newsteam/legacy-cli-config
Description: Newsteam command line tools
Author: News Team
Latest version: 0.0.27

# @newsteam/cli

[![License](https://img.shields.io/npm/l/@newsteam/cli.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/cli/latest.svg)](https://www.npmjs.com/package/@newsteam/cli)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/cli.svg)](https://www.npmjs.com/package/@newsteam/cli)
[![Dependencies](https://img.shields.io/david/feight/newsteam.svg?path=packages%2Fcli)](https://david-dm.org/feight/newsteam?path=cli)
[![DevDependencies](https://img.shields.io/david/feight/newsteam.svg?path=packages%2Fcli)](https://david-dm.org/feight/newsteam?type=dev&path=cli)
npm package: @newsteam/legacy-cli-errors
Description: This package provides a collection of cli error classes.
Author: News Team
Latest version: 0.0.14

# @newsteam/legacy-cli-errors

[![License](https://img.shields.io/npm/l/@newsteam/legacy-cli-errors.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/legacy-cli-errors/latest.svg)](https://www.npmjs.com/package/@newsteam/legacy-cli-errors)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/legacy-cli-errors.svg)](https://www.npmjs.com/package/@newsteam/legacy-cli-errors)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?path=legacy-cli-errors)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?type=dev&path=legacy-cli-errors)

This package provides a collection of cli error classes.

## Install

```
$ npm install @newsteam/legacy-cli-errors
```
## Simple usage

```js
import { util } from "@newsteam/legacy-cli-errors";

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/legacy-cli-logger
Description: This package provides a logger for command line interfaces
Author: News Team
Latest version: 0.0.16

# @newsteam/legacy-cli-logger

[![License](https://img.shields.io/npm/l/@newsteam/legacy-cli-logger.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/legacy-cli-logger/latest.svg)](https://www.npmjs.com/package/@newsteam/legacy-cli-logger)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/legacy-cli-logger.svg)](https://www.npmjs.com/package/@newsteam/legacy-cli-logger)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Flegacy-cli-logger)](https://david-dm.org/feight/packages?path=legacy-cli-logger)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Flegacy-cli-logger)](https://david-dm.org/feight/packages?type=dev&path=legacy-cli-logger)

This package provides a logger for command line interfaces.

## Install

```
$ npm install @newsteam/legacy-cli-logger
```
## Simple usage

```js
import { logger } from "@newsteam/legacy-cli-logger";

logger.log(label, message);

```
## Customized usage

```js
import { Logger } from "@newsteam/legacy-cli-logger";

const logger = new Logger();

logger.log(label, message);

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/legacy-service-worker
Description: Exports a ServiceWorker class that can be used to automatically configure a server worker for the Assemble framework.
Author: News Team
Latest version: 0.0.13

# @newsteam/legacy-service-worker

[![License](https://img.shields.io/npm/l/@newsteam/legacy-service-worker.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/legacy-service-worker/latest.svg)](https://www.npmjs.com/package/@newsteam/legacy-service-worker)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/legacy-service-worker.svg)](https://www.npmjs.com/package/@newsteam/legacy-service-worker)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?path=legacy-service-worker)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?type=dev&path=legacy-service-worker)

Exports a ServiceWorker class that can be used to automatically configure a server worker for the Assemble framework.

## Install

```
$ npm install @newsteam/legacy-service-worker
```
## Simple usage

```js
import { ServiceWorker } from "@newsteam/legacy-service-worker";


const serviceWorker = new ServiceWorker();

serviceWorker.start();

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/legacy-settings
Description: Assemble framework settings.
Author: News Team
Latest version: 0.0.14

# @newsteam/legacy-settings

[![License](https://img.shields.io/npm/l/@newsteam/legacy-settings.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/legacy-settings/latest.svg)](https://www.npmjs.com/package/@newsteam/legacy-settings)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/legacy-settings.svg)](https://www.npmjs.com/package/@newsteam/legacy-settings)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?path=legacy-settings)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?type=dev&path=legacy-settings)

Webpack configuration for the assemble framework.

## Install

```
$ npm install @newsteam/legacy-settings
```
## Simple usage

```js
const config = require("@newsteam/legacy-settings");

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/legacy-webpack-config
Description: Webpack configuration for the assemble framework.
Author: News Team
Latest version: 0.0.59

# @newsteam/legacy-webpack-config

[![License](https://img.shields.io/npm/l/@newsteam/legacy-webpack-config.svg)](https://github.com/feight/packages/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/legacy-webpack-config/latest.svg)](https://www.npmjs.com/package/@newsteam/legacy-webpack-config)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/legacy-webpack-config.svg)](https://www.npmjs.com/package/@newsteam/legacy-webpack-config)
[![Dependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?path=legacy-webpack-config)
[![DevDependencies](https://img.shields.io/david/feight/packages.svg?path=packages%2Futils)](https://david-dm.org/feight/packages?type=dev&path=legacy-webpack-config)

Webpack configuration for the assemble framework.

## Install

```
$ npm install @newsteam/legacy-webpack-config
```
## Simple usage

```js
const config = require("@newsteam/legacy-webpack-config");

```
## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/postcss-config
Description: Shared config for postcss
Author: News Team
Latest version: 0.0.57

# @newsteam/postcss-config

[![License](https://img.shields.io/npm/l/@newsteam/postcss-config.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/postcss-config/latest.svg)](https://www.npmjs.com/package/@newsteam/postcss-config)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/postcss-config.svg)](https://www.npmjs.com/package/@newsteam/postcss-config)

This package provides a shared config for postcss and several of its plugins.

## Usage

A single postcss configuration is exported.

Our default export contains all of our postcss plugins.

### Installation

1. Install the shared configuration:

```sh
npm install --save-dev @newsteam/postcss-config
```

2. Add to your postcss.config.js.

```js
const config = require("@newsteam/postcss-config");

module.exports = config;
```

## Maintenance

You can run tests with `npm test`.
npm package: @newsteam/stylelint
Description: Collection of stylelint dependencies
Author: News Team
Latest version: 0.0.80

# @newsteam/stylelint

[![License](https://img.shields.io/npm/l/@newsteam/stylelint.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/stylelint/latest.svg)](https://www.npmjs.com/package/@newsteam/stylelint)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/stylelint.svg)](https://www.npmjs.com/package/@newsteam/stylelint)

This package provides a set of dependencies that can be used to run stylelint with @newsteam/stylelint-config without having to do the manual peer dependency install step required if you
install @newsteam/stylelint-config directly.

## Usage

### Installation

1. Install the package:

```sh
npm install --save-dev @newsteam/stylelint
```

2. Add `"extends": "@newsteam/stylelint"` to your .stylelintrc.
npm package: @newsteam/stylelint-config
Description: Shared config for stylelint
Author: News Team
Latest version: 1.0.3

# @newsteam/stylelint-config

[![License](https://img.shields.io/npm/l/@newsteam/stylelint-config.svg)](https://github.com/feight/newsteam/blob/master/LICENSE)
[![npm package](https://img.shields.io/npm/v/@newsteam/stylelint-config/latest.svg)](https://www.npmjs.com/package/@newsteam/stylelint-config)
[![npm downloads](https://img.shields.io/npm/dm/@newsteam/stylelint-config.svg)](https://www.npmjs.com/package/@newsteam/stylelint-config)

This package provides a shared config for stylelint and several of its plugins.

## Usage

A single stylelint configuration is exported.

Our default export contains all of our stylelint rules. It requires the following peer dependencies:

```
    stylelint
    stylelint-order
    stylelint-scss
```

### Installation

1. Install the shared configuration:

```sh
npm install --save-dev @newsteam/stylelint-config
```

2. Install the shared configuration peer dependencies (npm 5+):

```sh
npx install-peerdeps --dev @newsteam/stylelint-config
```

3. Add `"extends": "@newsteam/stylelint-config"` to your .stylelintrc.

## Maintenance

You can run tests with `npm test`.
npm package: @newstudios/common
Description: a common lifecycle and event utils for js
Author: tangye
Latest version: 0.2.2

# @newstudios/common

  [![NPM Version][npm-image]][npm-url]

## Installation

```bash
npm install @newstudios/common
```
or
```bash
yarn add @newstudios/common
```

## LICENSE

MIT

[npm-image]: https://img.shields.io/npm/v/@newstudios/common.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@newstudios/common
npm package: @newstudios/express-middleware-requestid
Description: A middleware that generates a unique Request ID for every incoming HTTP request in express.
Author: fe@xinpianchang.com
Latest version: 0.0.3

<div align="center">
  <h1>express-middleware-requestid</h1>
</div>

<p align="center">
  A middleware that generates a unique Request ID for every incoming HTTP request in express.
</p>

## How to develop

Using `VSCode` as deafult for *debugger*

```
# Using NPM
npm run example

# Using Yarn
yarn example
```


## Dependencies

- [**uuid**](https://github.com/uuidjs/uuid)
- [**bson**](https://github.com/mongodb/js-bson)



## How to use
### Installation

```
# Using NPM
$ npm install --save @newstudios/express-middleware-requestid

# Using Yarn
$ yarn add @newstudios/express-middleware-requestid
```



## Usage

Use `@newstudios/express-middleware-requestid` as a middleware for a [express](https://github.com/expressjs/express) app. By default, it generates a unique uuid (v4) and exposes it on the response via the `X-Request-ID` header. The id is also saved as part of the *req.id*、*req.request.id*、*req.id*.

In the following example, the generated uuid is manually exposed on the body for debugging purposes:

```js
const express = require('express');
const requestId = require('@newstudios/express-middleware-requestid');
const app = express();

app.use(requestId({
  type: 'object-id'  // uuid
}));

app.get('/', function (req, res, next) {
  console.log('new v4 id', requestId.generateID())
  console.log('new bson id', requestId.generateID('object-id'))
  console.log('req.id', req.id)
  res.send('req id is' + req.id)
  next();
});

app.listen(3000);
```

Execute a request to the running app:

```bash
❯ curl -v http://localhost:3000

< HTTP/1.1 200 OK
< X-Request-ID: 5ea534105429c3f44cfb188c

5ea534105429c3f44cfb188c
```


## API

### Creating an middleware

```node
// With default options
const middleware = requestId({
  header: 'X-Request-ID',
  property: 'id',
  type: 'object-id'
});
```

### Middleware Configuration

These are the available config options for the middleware. All is optional. 
The middleware try to get the request id from `X-Request-ID` request header or generate a new request id using `uuidv4` generator or `bson`.

```node
{
  // Request header name to get the forwarded request id
  header: 'X-Request-ID',

  // generate id using bson or uuid
  // 'uuid' | 'object-id'
  type: 'object-id'
}
```

also has a method generateID
```
default generate uuid, you can set type as *generateID('object-id')*
```

```
new v4 id fad3039d-091f-4611-8288-8c9b90d71697
server.js:11
new bson id 5ea543b87fe39832cee0db5c
```


## License

Provided under the terms of the MIT License

Copyright © 2020, [xinpianchang](https://www.xinpianchang.com).
npm package: @newstudios/hook
Description: common hooks for react
Author: tanghongyu
Latest version: 1.1.1

# @newstudios/hook

  [![NPM Version][npm-image]][npm-url]

## Installation

```bash
npm install @newstudios/hook
```
or
```bash
yarn add @newstudios/hook
```

## Starter
### hooks

* `useArrowKey` listen to arrow key state change and get the latest state
* `useInvalidator` use invalidator to invalidate the target at the next animation frame
* `useCanvasInvalidator` a special invalidator to draw canvas at the next aniation frame
* `useClickAway` listen click event outside the target
* `useDevicePixelRatio` listen to the device pixel ratio change and get the latest devicePixelRatio
* `useDrag` a simple hook to process the dragging state and callback
* `useEvent` a hook to bind listener(s) to event target
* `useHover` a hook to get the mouse hover state of the target
* `useList` a hook to manage collections
* `useUpdate` get a static callback to force update the component
* `useNextUpdate` get a static callback to update the componenent next event loop
* `useRaf` a hook to call requestAnimationFrame whose lifecycle is self managed
* `useRefObject` a hook to reference any object from the argument
* `useResize` a hook to listen to the resize event of the target
* `useResizeObserver` a hook to get the default or customed provided ResizeObserver instance
* `useSafeClick` manage the click event from the target and assure the gesture not to be dragging
* `useSetupCanvas` a hook for setup the canvas and set the canvas width and height automatically
* `useShortcutKey` listen to the shortcut key
* `useShortcutKeys` listen to the multiple shortcut keys
* `useThrottle` invoke a callback with throttle
* `useThrottleCallback` get a callback which will be invoked with throttle

## LICENSE

MIT

[npm-image]: https://img.shields.io/npm/v/@newstudios/hook.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@newstudios/hook
npm package: @newstudios/koa2-middleware-requestid
Description: A middleware that generates a unique Request ID for every incoming HTTP request in Koa2.
Author: chengyu@xinpianchang.com
Latest version: 2.1.0

<div align="center">
  <h1>koa2-middleware-requestid</h1>
</div>

<p align="center">
  A middleware that generates a unique Request ID for every incoming HTTP request in Koa2.
</p>

## How to develop

Using `VSCode` as deafult for *debugger*

```
# Using NPM
npm run example

# Using Yarn
yarn example
```


## Dependencies

- [**uuid**](https://github.com/uuidjs/uuid)
- [**bson**](https://github.com/mongodb/js-bson)



## How to use
### Installation

```
# Using NPM
$ npm install --save @newstudios/koa2-middleware-requestid

# Using Yarn
$ yarn add @newstudios/koa2-middleware-requestid
```



## Usage

Use `@newstudios/koa2-middleware-requestid` as a middleware for a [koa](https://github.com/koajs/koa) app. By default, it generates a unique uuid (v4) and exposes it on the response via the `X-Request-ID` header. The id is also saved as part of the *ctx.req.id*、*ctx.request.id*、*ctx.id*.

In the following example, the generated uuid is manually exposed on the body for debugging purposes:

```js
const Koa = require('koa');
const requestId = require('@newstudios/koa2-middleware-requestid');
const app = new Koa();

app.use(requestId());
app.use(async ctx => {
  ctx.body = ctx.id;
});

app.listen(3000);
```

Execute a request to the running app:

```bash
❯ curl -v http://localhost:3000

< HTTP/1.1 200 OK
< X-Request-ID: 5ea534105429c3f44cfb188c

5ea534105429c3f44cfb188c
```


## API

### Creating an middleware

```node
// With default options
const middleware = requestId({
  header: 'X-Request-ID',
  property: 'id',
  type: 'object-id'
});
```

### Middleware Configuration

These are the available config options for the middleware. All is optional. 
The middleware try to get the request id from `X-Request-ID` request header or generate a new request id using `uuidv4` generator or `bson`.

```node
{
  // Request header name to get the forwarded request id
  header: 'X-Request-ID',

  // generate id using bson or uuid
  // 'uuid' | 'object-id'
  type: 'object-id'
}
```

also has a method generateID
```
default generate uuid, you can set type as *generateID('object-id')*
```

```
new v4 id fad3039d-091f-4611-8288-8c9b90d71697
server.js:11
new bson id 5ea543b87fe39832cee0db5c
```


## License

Provided under the terms of the MIT License

Copyright © 2020, [xinpianchang](https://www.xinpianchang.com).