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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datafordeler/ebr

v0.2.2

Published

Datafordeler SDK for Javascript Ebr Client (Ejendomsbeliggenhedsregistret) for Node.js

Downloads

104

Readme

@datafordeler/ebr

Overview

This is an unofficial SDK for interacting with the Ejendomsbeliggenhed service provided by Datafordeler, a Danish public data distribution platform. The Ejendomsbeliggenhed service contains detailed data about property location and maps bfe numbers to adresses and housenumbers.

This SDK is designed to be type-safe, providing well-defined input and output types for all interactions, ensuring a smooth and predictable developer experience.

Installing

To install this package, use one of the following commands depending on your package manager:

  • npm install @datafordeler/ebr
  • yarn add @datafordeler/ebr
  • pnpm add @datafordeler/ebr

Usage

The client exposes a set of methods designed to be type-safe, ensuring that you can work with strongly typed data throughout your application.

Here's a basic example of how to use the client:

import { EBR } from '@datafordeler/ebr';

const authConfig = {}; // See below for authentication
const client = new EBR(authConfig);

const result = await client.BFEnrAdresse({
  HusnummerId: '12345678',
  Status: 'Gældende',
});

console.log(result.features[0]?.properties); // { id_lokalId: ... }

Authentication

The client requres authentication, either using credentials or a certificate. The authentication method is specified when creating the client.

If the client is configured with both credentials and a certificate, the client will use the certificate for authentication.

The certificate should be in PFX / P12 format and can be provided using one of the following methods:

import { Agent } from "undici";
import { EBR } from '@datafordeler/ebr';

const connect = {
  keepAlive: true,
  rejectUnauthorized: false;
  passphrase: "my-passphrase",
  pfx: fs.readFileSync("path/to/cert.pfx"),
  // ... other settings
}

const agent = new Agent({ connect });
const client = new EBR({ agent });
// call servuces

Here's an example of how to provide a certificate using a path:

import { EBR } from '@datafordeler/ebr';

const agentConfig = {
  certPath: 'path/to/cert.pem',
  passphrase: 'my-passphrase',
};

const client = new EBR({ agentConfig });
// call services

Configuring the client with credentials:

import { EBR } from '@datafordeler/ebr';

const client = new EBR({ credentials: { username: <USERNAME>, password: <PASSWORD> }, });
// call services

Methods

The client exposes a set of methods for interacting with the EBR service. Each method corresponds to an endpoint in the service and is designed to be type-safe, ensuring that you can work with strongly typed data throughout your application.

Get the bfenumber of a property based on the housenumberId

import { EBR } from '@datafordeler/ebr';
const client = new EBR({...});

const result = await client.BFEnrAdresse({
  HusnummerId: '12345678',
  Status: 'Gældende',
});

Get the location (ejendomsbeliggenhed) of a property based on the bfe number

import { EBR } from '@datafordeler/ebr';
const client = new EBR({...});

const result = await client.Ejendomsbeliggenhed({
  BFEnr: 12345678,
  Status: 'Gældende',
});

Get the a simplified location (ejendomsbeliggenhedSimpel) of a property based on the bfe number

import { EBR } from '@datafordeler/ebr';
const client = new EBR({...});

const result = await client.EjendomsbeliggenhedSimpel({
  BFEnr: 12345678,
  Status: 'Gældende',
});

Maintanance and updates

We strive to keep all our SDK clients, including @datafordeler/ebr, up to date with the latest changes and improvements in the corresponding Datafordeler services. Our goal is to ensure compatibility and provide a seamless experience for developers.

However, please note that we cannot guarantee that all services will be updated immediately in response to changes in the Datafordeler platform. There may be instances where updates are delayed due to unforeseen circumstances or dependencies on external factors.

We encourage users to report any issues or discrepancies they encounter, and we will do our best to address them in a timely manner.

Contributing

Contributions are welcome! If you'd like to contribute to this project, please follow the standard GitHub flow:

Fork the repository Create a new branch Make your changes Submit a pull request Please ensure all new code is properly tested and follows the existing code style.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

This SDK is developed and maintained by Simon Saxtorph @HelloAgent and @EstateHub. Special thanks to the Datafordeler team for providing the APIs.