pg-coalesce

1.0.3 • Public • Published

nodejs-coalesce

Implementation of SQL's coalesce function: return the first argument that is not null

Features

From Postgres document: https://www.postgresql.org/docs/9.5/functions-conditional.html

The COALESCE function returns the first of its arguments that is not null. Null is returned only if all arguments are null.

Usage

Install

npm install pg-coalesce

Using:

const coalesce = require("pg-coalesce");
 
console.log(coalesce(null, "Hello world")); //Hello world

/pg-coalesce/

    Package Sidebar

    Install

    npm i pg-coalesce

    Weekly Downloads

    1

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    4.51 kB

    Total Files

    6

    Last publish

    Collaborators

    • zeroboo