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 right-align-keys with all npm packages installed. Try it out:

var rightAlignKeys = require("right-align-keys")

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

right-align-keys v0.1.2

Right align the keys of an object.

right-align-keys NPM version Build Status

Right align the keys of an object.

Install

Install with npm

$ npm i right-align-keys --save

Usage example

align({
  a: 'x', 
  bbb: 'x', 
  ccccc: 'x', 
  ddddddd: 'x'
});

Results in:

{
  '      a': 'x',
  '    bbb': 'x',
  '  ccccc': 'x',
  'ddddddd': 'x'
}

Related projects

  • longest: Get the longest item in an array.
  • longest-value: Get the longest value for the given property from an array of objects, or the… more
  • pad-left: Left pad a string with zeros or a specified string. Fastest implementation.
  • pad-right: Right pad a string with zeros or a specified string. Fastest implementation.
  • repeat-element: Create an array by repeating the given value n times.
  • repeat-string: Repeat the given string n times. Fastest implementation for repeating a string.
  • right-align-values: Right align the values of a given property for each object in an array. Useful… more
  • right-pad-keys: Right pad the keys of an object.
  • right-pad-values: Right pad the values of a given property for each object in an array. Useful… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on August 15, 2015.

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