New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nullnot

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nullnot

Nullnot is a very small library that checks if a template literal has a null value. If it does, it return nothing. But if it doesn't then it simply return the result of the string literal. This could be useful for making strings from variables and you all

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

nullnot

Nullnot is a very small library that checks if a template literal has a null value. If it does, it return nothing. But if it doesn't then it simply return the result of the string literal. This could be useful for making strings from variables and you allow the variables to be null.

Installation

You can install story-gen by doing npm install nullnot or yarn add nullnot.

Usage

If you need a message from a name, and an email that can be null. You could ensure the email part is not included by doing the following:

const { nn } = require('notnull')

const getMessage = (name, email) => {
    email = nn`Your email is ${email}.`;
    
    return `Hello, ${name}. ${email}`;
}

console.log(getMessage('Samyos')); // Hello, Samyos.
console.log(getMessage('Samyos', 'samy.osmium@gmail.com')); // Hello, Samyos. Your email is samy.osmium@gmail.com

FAQs

Package last updated on 16 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts