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

binary-prefix

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binary-prefix

Return a list of binary or decimal SI unit prefixes.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
467
increased by9240%
Maintainers
1
Weekly downloads
 
Created
Source

Binary-Prefix Build Status

A Javascript library for retrieveing a list of binary or decimal SI unit prefixes

Install

$ npm install --save binary-prefix 

Usage

var prefixes = require('binary-prefix');

prefixes.binary;
//=> {
//=>   B: 'B',
//=>   KB: 'KB',
//=>   MB: 'MB',
//=>   GB: 'GB',
//=>   TB: 'TB', 
//=>   PB: 'PB',
//=>   EB: 'EB',
//=>   ZB: 'ZB',
//=>   YB: 'YB'
//=> }
prefixes();
//=> {
//=>   B: 'B',
//=>   KB: 'KB',
//=>   MB: 'MB',
//=>   GB: 'GB',
//=>   TB: 'TB', 
//=>   PB: 'PB',
//=>   EB: 'EB',
//=>   ZB: 'ZB',
//=>   YB: 'YB'
//=> }

// Getting a list of decimal prefixes
prefixes.decimal;
//=> {
//=>   B: 'B',
//=>   KB: 'kB',
//=>   MB: 'MB',
//=>   GB: 'GB',
//=>   TB: 'TB', 
//=>   PB: 'PB',
//=>   EB: 'EB',
//=>   ZB: 'ZB',
//=>   YB: 'YB'
//=> }
prefixes({ decimal: true });
//=> {
//=>   B: 'B',
//=>   KB: 'kB',
//=>   MB: 'MB',
//=>   GB: 'GB',
//=>   TB: 'TB', 
//=>   PB: 'PB',
//=>   EB: 'EB',
//=>   ZB: 'ZB',
//=>   YB: 'YB'
//=> }

// Using custom prefixes
prefixes({ custom: { KB: 'kilobytes', GB: 'gigga-bytes' } });
//=> {
//=>   B: 'B',
//=>   KB: 'kilobytes',
//=>   MB: 'MB',
//=>   GB: 'gigga-bytes',
//=>   TB: 'TB', 
//=>   PB: 'PB',
//=>   EB: 'EB',
//=>   ZB: 'ZB',
//=>   YB: 'YB'
//=> }

License

MIT © Andrew Kennedy

Keywords

FAQs

Package last updated on 17 Jul 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