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

node-extra-funcs

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

node-extra-funcs

A string library that adds additional functions to the String object.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

node-extra-funcs

Build Status

About

A node.js library intending to expand some of the functions available to built-ins

Functions

You can find examples below, or hop over to the docs:

  • math
  • string

Example

Code (See examples/string-example.js)

var strFuncController = require("../").string;

strFuncController.enableAll();
console.log("\n");

console.log("5".padLeft("0", 5));
console.log("");

console.log("FUN!".padLeft("-", 9));
console.log("");

console.log("1".padRight(",000", 13));
console.log("");

console.log("fix".prepend("pre"));
console.log("");

console.log(JSON.stringify({
  "name": "Fred",
  "role": "Superhero",
  "mascot": "Platypus"
}, null, 2).indent(4));

Output

00005

-----FUN!

1,000,000,000

prefix

{
  "name": "Fred",
  "role": "Superhero",
  "mascot": "Platypus"
}

Code (See examples/math-example.js

var mathFuncController = require("../").math;

mathFuncController.enableAll();
console.log("\n");

console.log(Math.floor10(999, 2));
console.log();

console.log(Math.ceil10(111, 3));
console.log();

console.log(Math.round10(5000, 4));
console.log();

Output

900

1000

1000

FAQs

Package last updated on 19 Jun 2016

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