npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

adrez-mapper

v0.2.4

Published

Map objects in to the AdreZ format

Readme

#adrez-mapp

npm install https://github.com/toxus/adrez-mapper.git --save

Convert a raw address record into the workable version for the AdreZ api

const Record = require('adrez-mapper').AdrezRecord;
const Logger = require('logger');
const Lookup = require('adrez-mapper').Lookup;


class LocalLookup extends Lookup {
   // see Lookup for more options   
   async gender(fieldName, contactObj, defaults, data) {
     // do anything to data and return the type of address
     return 105;
   }
}
let logger = new Logger({toConsole: false});

const options = {
  // the default lookup
  lookup : new LocalLookup(),
}

let upd = new Record(options);
const fieldData = {
  contact: [{ name: 'Tester'}],
  telephone: [
    {type: 'mobile', telephoneInt: '06123455667'}, 
    {typeId: 2314, telephone: '021030120123012'}
    ]
}

let result = upd.convert('rec', fieldData, logger);
console.log(result)
    {
      contact: [
        { name: 'Tester'}
        ],
      telephone: [ 
        {typeId: 12345, value: '+31 123455667'},
        {typeId: 2314, value: '021030120123012'}
      ]
    }

class Lookup

lookup function

The folling baseType can be expected:

  • contact - value is text of type, result is the typeId

  • telephone - value is text, result is the id

  • email - value is text, result is the id

  • code - value is text, result is the id

  • extra - value is text, result is the id

  • memo - value is text, result is the id

  • country - value is the name of the country, result is the countryId

  • country.zipcode - value is the zipcode. Try to find a country for it. return countryId or undefined

  • country.numberRight - value is the countryId. true if number is on the right.

  • street - value is the Object: {zipcode, number, countryId}, result: the name of the street

  • zipcode - value is the Object: {street, number, city, countryId}, result: the name of the zipcode

  • zipcode - value is zipcode, try to find the country, returns the countryId or undefined

  • gender - value is object {firstName, title, subName}, returns the typeId. It's allowed to modify the data object to reflect the gender change. Return false or undefined if no change is needed. Overrules the record defined typeId, so typeId will be the default.

  • contactFunction - the value is the textual definition of the function, returns the id

  • contactSalutation the value is the salutation, returns the id

(c) MIT 2019 Toxus