Narwhals Playing Mahjong

    @supernova350/mongoexpress
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.5 • Public • Published

    mongoexpress

    DeepScan grade npm shield

    Key-value MongoDB store written in TypeScript.

    Importing

    ESM (TypeScript)

    import { MongoExpress } from '@supernova350/mongoexpress';

    CommonJS (JavaScript)

    const { MongoExpress } = require('@supernova350/mongoexpress');

    Example Usage

    // initialize a MongoExpress instance
    const mongoexpress = new MongoExpress({ connectionString: '' });
    
    // log 'ready' when connected
    mongoexpress.on('ready', () => console.log('[mongoexpress] connected'));
    
    // connect to database
    await mongoexpress.connect();
    
    // set value of key 'x' to 5
    await mongoexpress.set('x', 5);
    // get value of key 'x' and log
    console.log(await mongoexpress.get('x')); // => 5

    Install

    npm i @supernova350/mongoexpress

    DownloadsWeekly Downloads

    6

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    9.94 kB

    Total Files

    7

    Last publish

    Collaborators

    • supernova350