node package manager


Helper methods and utils for apis


Helper functions used in the apis project.

$ npm install apis-helpers
var helpers = require('apis-helpers');
// there are a few methods. getting a random user agent: 
  • helpers.currency: A an object mapping a currency name to a short version and the icelandic name.
  • helpers.mergeObjects(obj1, obj2): merges properties of one object to the other. No deep clone. You could just as well use one of the thousands of such modules out there
  • helpers.browser(): returns a random browser user agent. Useful for scraping
  • helpers.deArrayfy(object): Takes an object and an array and iterates thorugh them. If the object/array contains an array with the lenght of 1, it will flatten it out to reference the contents of that array directly.