Socket
Socket
Sign inDemoInstall

beltjs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beltjs

A lightweight tool belt for basic daily tasks.


Version published
Weekly downloads
1
decreased by-91.67%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status NPM version

beltjs

A lightweight tool belt for basic daily tasks.

Getting started

  • Just install the tool directly via npm: npm install beltjs
  • Require it as normal: var belt = require('beltjs');. Usage-example: belt.number.isInt(42);
  • Alternatively you can require specific modules - e.g. the string modul for useful functions regarding strings: var stringUtils = require('beltjs').string;. Usage-example: stringUtils.contains(string1, string2);

API

Currently the following modules are ready for use. The API is stable for now. Breaking changes will be announced and semver version numbering is used.

  • module: string

    • contains: Checks if a string is contained in another. An optional parameter for case insensitive checking is available.
    • startsWith: Checks if a string starts with another. An optional parameter for case insensitive checking is available.
    • endsWith: Checks if a string ends with another. An optional parameter for case insensitive checking is available.
  • module: number

    • isNumeric: Checks if the provided object is numeric.
    • isInt: Checks if the provided object is an integer. Attention: This method considers e.g. 1.0 as an integer.
    • isFloat: Checks if the provided object is a float. Attention: This method considers e.g. 1.0 not as a float value.
    • Note: isInt and isFloat consider values somewhat like they would be printed. The used example 1.0 will be printed as 1 by node.

Please checkout the source code for more information on how to use this until there is a better API documentation. There are plenty of tests for all the functions.

FAQs

Package last updated on 09 Mar 2015

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