Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rightech/shrink-mongo-id

Shrink MongoDB's ObjectId
https://github.com/rightech/shrink-mongo-id

hex mongodb objectid shorten

Last synced: 27 days ago
JSON representation

Shrink MongoDB's ObjectId

Awesome Lists containing this project

README

        

# Shrink MongoDB's ObjectId

Heavily based on https://github.com/treygriffith/short-mongo-id

But without external node dependencies.

Suit for `node` and `browser`.

# Install

```console
npm install --save shrink-mongo-id
```

# Usage

```js
const shortid = require('shrink-mongo-id');
const shortnd = shortid('5d0efa88f85b2f001172f6ba');
console.log(shortnd); // => 'ahGw2K'
```