Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/rightech/shrink-mongo-id
- Owner: Rightech
- License: mit
- Created: 2019-06-23T02:25:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-24T23:50:26.000Z (over 5 years ago)
- Last Synced: 2024-10-18T10:36:45.647Z (30 days ago)
- Topics: hex, mongodb, objectid, shorten
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'
```