Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nicer-toolbox

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nicer-toolbox

A toolbox of useful functions including preventWidows and asyncForEach.

  • 1.0.7
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Nicer Toolbox

A toolbox of useful functions.

List of functions

  • asyncForEach
  • preventWidows

asyncForEach

Allows await inside of a foreach loop.

// For Node
const { asyncForEach } = require("nicer-toolbox");
// For React
import { asyncForEach } from "nicer-toolbox";

// Basic Usage
asyncForEach(arrayOfItems, callBackFunction);

// Example
const contacts = ["zzsvrqyalq", "fz12nawb3g", "ugfqduns16", "0bulps6hrb"];

asyncForEach(contacts, async id => {
  return await getUserData(id);
});

preventWidows

Add as NBSP (non-breaking space) between the last to words to prevent unwanted word wraps.

import { preventWidows } from "nicer-toolbox";

// Basic Usage
preventWidows("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");

Keywords

FAQs

Package last updated on 28 Feb 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc