Nutmeg Pumpkin Macchiato

    ts-parse-database-url
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    TypeScript Parse Database Url

    Install

    $ npm i ts-parse-database-url
    

    Usage

    import parseDatabaseUrl from 'ts-parse-database-url';
    
    const dbUrl = 'mysql://someuser@server.heroku.com:1337/herokudb'
    const parsed = parseDatabaseUrl(dbUrl)
    
    /**
     * parsed = {
     *   'driver': 'mysql',
     *   'user': 'someuser',
     *   'host': 'server.heroku.com',
     *   'port': '1337',
     *   'database': 'herokudb'
     * }
    */
    

    Look at src/__tests__ for more tests examples.

    Thanks to https://github.com/pwnall/node-parse-database-url for creating the original lib 🎉

    Keywords

    none

    Install

    npm i ts-parse-database-url

    DownloadsWeekly Downloads

    6,344

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    6.78 kB

    Total Files

    5

    Last publish

    Collaborators

    • herlon214