open-index/open-npm huggingface dataset:
npm package: @cdxoo/mongodb-utils
Description: simple mongodb utils
Author: Jan Schwalbe
Latest version: 1.0.1

# @cdxoo/mongodb-utils

Tiny package containing 3 simple mongodb query utilities.

## Installation

    npm install --save @cdxoo/dbscan

## Usage

```javascript
const {
    aggregateOne,
    aggregateToArray,
    aggregateToCursor
} = require('@cdxoo/mongodb-utils');

const { MongoClient } = require('mongodb');
const db = (await new MongoClient(/* ... */).connect()).db();

let doc = await aggregateOne({
    db,                           // mongodb database handle
    myCollection: [               // aggregate stages or object (see below)
        { $match: {
            _id: 1234
        }},
        /* ... */
    ],
    mongoSettings: { /* ... */ }  // optional aggregate options like: session,
                                  // readConcern, allowDiskUseetc
})

// if you dont really need any stage apart from $match there is
// this shorthand in all the utilites
let doc_alt = await aggregateOne({ db, myCollection: {
    _id: 1234
}})

let manydocs = await aggregateToArray({ db, myCollection: [
    { $match: {
        x: { $gt: 9000 }
    }}
]})

let cursorL10 = aggregateToCursor({ db, myCollection: [
    { $match: {
        x: { $gt: 9000 }
    }}
]}).limit(10);

for await (let doc of cursorL10) {
    /**/
}
```
npm package: @cebus/react-dialog
Description: A Dialog component that presents a surface that users can either complete tasks or obtain information from.
Latest version: 0.0.1

# Dialog

The Dialog component presents a surface that users can either complete tasks or obtain information from.

## Use

1. Install the @cebus/react-dialog component.

Using NPM

```
npm install @cebus/react-dialog
```

Using Yarn

```
yarn add @cebus/react-dialog
```

2. Install the @cebus/react-provider and our theme tokens from @cebus/react-theme

3. Set up the provider in your app:

```jsx
import { Provider } from '@cebus/react-provider'
import { webLightTheme } from '@cebus/react-theme'

const MyApp = () => {
  return (
    <Provider theme={webLightTheme}>
    <Provider>
  )
}
```

4. Integrate the Dialog component.

```jsx
import { Provider } from '@cebus/react-provider'
import { web1ghtTheme } from '@cebus/react-theme'
import { Dialog } from '@cebus/react-dialog'

const MyApp = () => {
  return (
    <Provider theme={webLightTheme}>
      <Dialog>...</Dialog>
    <Provider>
  )
}
```

## API

To learn more about the Dialog API take a look at the [Dialog Interface](src/components/Dialog/Dialog.types.ts) file.
npm package: @cebus/react-form
Description: A Form control that helps easily set up an accessible form.
Latest version: 0.0.7

# Button

The Button controls allow users to make an action through a press.

## Use

1. Install the @cebus/react-button component.

Using NPM

```
npm install @cebus/react-button
```

Using Yarn

```
yarn add @cebus/react-button
```

2. Install the @cebus/react-provider and our theme tokens from @cebus/react-theme

3. Set up the provider in your app:

```jsx
import { Provider } from '@cebus/react-provider'
import { webLightTheme } from '@cebus/react-theme'

const MyApp = () => {
  return (
    <Provider theme={webLightTheme}>
    <Provider>
  )
}
```

4. Integrate the Button component.

```jsx
import { Provider } from '@cebus/react-provider'
import { webLightTheme } from '@cebus/react-theme'
import { Button } from '@cebus/react-button'

const MyApp = () => {
  return (
    <Provider theme={webLightTheme}>
      <Button>Hello World</Button>
    <Provider>
  )
}
```

## API

To learn more about the Button API take a look at the [Button Interface](src/components/Button/Button.types.ts) file.
npm package: @cedric0303/id-generator
Description: ID generators for SG and HK
Author: Jun Li Chen
Latest version: 0.3.0

# @cedric0303/id-generator

## Installation

Install globally to use `sgid` or `hkid`:

```sh
npm install --global @cedric0303/id-generator

yarn global add @cedric0303/id-generator

bun add --global @cedric0303/id-generator
```

Install locally to use in projects:

```sh
npm install @cedric0303/id-generator

yarn add @cedric0303/id-generator

bun add @cedric0303/id-generator
```

## Global Usage

```sh
> sgid
A5758052

> hkid
S8541816E

// output automatically copied to clipboard
```

See `sgid --help` or `hkid --help` for more details

## Module/Programmatic Usage

`@cedric0303/id-generato`r can be imported as a module:

```js
import {
  randomHKID,
  randomSGID,
  isValidHKID,
  isValidSGID
} from "@cedric0303/id-generator";

const hkid = await randomHKID();
const sgid = await randomSGID();

console.log(hkid, isValidHKID(hkid));
console.log(sgid, isValidSGID(sgid));
```

## Acknowledgements

This project incorporates code from the following projects:

- [hkid-generator](https://github.com/icelam/hkid-generator) by [icelam](https://github.com/icelam) (License: ISC)
- [singapore-nric](https://github.com/samliew/singapore-nric) by [samliew](https://github.com/]samliew) (License: MIT)