0.1.1 • Published 9 years ago

px-em v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

px-em Build Status

A module to convert PX in EM.

Installation

$ [sudo] npm install --save px-em

Usage

var pxEm = require('px-em');

pxEm(16, 24, true)
  .then(function(em) {
    console.log(em); // 0.667em
  })
  .catch(function(err) {
    console.log(err.message);
  });

Or

var pxEm = require('px-em');

pxEm('16px', '24px', true)
  .then(function(em) {
    console.log(em); // 0.667em
  })
  .catch(function(err) {
    console.log(err.message);
  });

API

pxEm(px, [base], [format])

Type: number or string

Returns a promise that resolves to the value converted.

px

Required
Type: number or string

Pixel value to converting.

base

Type: number or string
Default: 16

Base value to converting.

format

Type: boolean
Default: false

Format value to formatting.

Related

See em-px for the inverse.

License

MIT © Cícero Pablo

0.1.1

9 years ago

0.1.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago