Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including paper-rulings with all npm packages installed. Try it out:

var paperRulings = require("paper-rulings")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

paper-rulings v1.3.15

Measurements and information about paper rulings

paper-rulings

Build Status NPM Version Coverage

Measurements and information about paper rulings

Installation

npm install --save paper-rulings

Usage

const paperRulings = require('paper-rulings')

console.log(JSON.stringify(paperRulings('gregg', { format: 'decimal', units: 'mm' }), null, 2))

Output

{
  "names": [
    "Gregg"
  ],
  "spacing": "8.730823935791932 mm",
  "margins": [
    {
      "left": "50%"
    }
  ],
  "notes": "Used for stenography. Includes a single margin down the center of the page."
}

API

paperRulings(rulingName, options)

rulingName

Type: string

One of the following:

  • Narrow
  • Medium
  • College
  • Wide
  • Legal
  • Gregg
  • Pitman
  • Quad

options

Type: object

options.format

Allows you to specify the output values formats

Type: string

One of the following:

  • fraction
  • decimal
options.units

Specify the output measurement units

Type: string

One of the following:

  • mm
  • cm
  • m
  • in
  • ft
  • mi
options.spacing

Quad ruling allows custom spacing

Type: string

A number followed by any of the units allowed in options.units

Examples:

  • 1/2 in
  • 10 mm
  • 0.1 ft

Change Log

v1.3.0 - 2017-06-30

  • added quad ruling

v1.2.0 - 2017-04-30

  • added unit conversions and units field in options

v1.1.0 - 2017-04-30

  • added decimal/fraction output formats and format field in options
  • improved options validation and handling

v1.0.0 - 2017-04-30

  • initial release

License

MIT © Forrest Desjardins

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free