Nine Parsecs from Milwaukee

    @tybys/oid-lite
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    oid-lite

    Use MongoDB ObjectID without installing bson.

    Usage

    $ npm install @tybys/oid-lite

    Browser

    <script src="https://cdn.jsdelivr.net/npm/@tybys/oid-lite/dist/oid.min.js"></script>
    
    <script>
    console.log(new oid.ObjectId().toHexString());
    </script>

    Symbol & TypedArray polyfill is required by legacy browsers. Use @tybys/oid for full support.

    <script src="https://cdn.jsdelivr.net/npm/@tybys/oid/dist/oid.min.js"></script>
    
    <script>
    console.log(new oid.ObjectId().toHexString());
    </script>

    Node.js

    const { ObjectId } = require('@tybys/oid-lite')
    console.log(new ObjectId())

    TypeScript

    import { ObjectId } from '@tybys/oid-lite'
    console.log(new ObjectId())

    API

    Same as mongodb/js-bson/src/objectid.ts.

    API Documentation

    Install

    npm i @tybys/oid-lite

    DownloadsWeekly Downloads

    6

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    143 kB

    Total Files

    12

    Last publish

    Collaborators

    • toyobayashi