# @tybys/oid

> Use MongoDB ObjectID without installing bson.

Latest version **4.0.0** (published 2021-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tybys/oid
pnpm add @tybys/oid
yarn add @tybys/oid
bun add @tybys/oid
```

Provides the command `oid`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-05-08 |
| First published | 2019-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 155.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | toyobayashi |
| Maintainers | toyobayashi |
| Keywords | bson, objectid, oid |

## Links

- npm: https://www.npmjs.com/package/@tybys/oid
- Repository: https://github.com/toyobayashi/oid
- Homepage: https://github.com/toyobayashi/oid/tree/master/js#readme
- Issues: https://github.com/toyobayashi/oid/issues
- npm.io page: https://npm.io/package/@tybys/oid

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2021-05-08
- 3.0.0 — 2020-09-02
- 2.0.2 — 2020-06-30
- 2.0.1 — 2020-06-28
- 2.0.0 — 2020-04-26
- 1.0.8 — 2020-01-17
- 1.0.7 — 2019-12-27
- 1.0.6 — 2019-10-10
- 1.0.5 — 2019-09-23
- 1.0.4 — 2019-09-20
- 1.0.3 — 2019-09-20
- 1.0.2 — 2019-09-20
- 1.0.0 — 2019-09-19

## README

# oid-js

Use MongoDB ObjectID without installing bson.

## Usage

``` bash
$ npm install @tybys/oid
```

### CLI

```
$ oid -h
Usage: oid [options]

Options:
  -v, -V, --version   output the version number
  -h, --help          output usage information
  -n, --number <N>    output N number of ObjectIds

Repo: https://github.com/toyobayashi/oid
```

### Browser

IE OK!

``` html
<script src="https://cdn.jsdelivr.net/npm/@tybys/oid/dist/oid.min.js"></script>

<script>
console.log(new oid.ObjectId().toHexString());
</script>
```

### Node.js

``` js
const { ObjectId } = require('@tybys/oid')
console.log(new ObjectId())
```

### TypeScript

``` ts
import { ObjectId } from '@tybys/oid'
console.log(new ObjectId())
```

## API

Same as [mongodb/js-bson/src/objectid.ts](https://github.com/mongodb/js-bson/blob/master/src/objectid.ts).

[API Documentation](https://github.com/toyobayashi/oid/blob/master/js/docs/api/index.md)

---
_Source: https://npm.io/package/@tybys/oid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
