@pacely/company-search-module
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

@pacely/vatsearch

npm version npm downloads License

Search for company records in all Nordic countries. Based on @pacely/vatsearch ⚡️

Features

  • 👌  Search for all companies in Norway, Denmark, Sweden and Finland
  •   Get opinionated Risk Analysis on all companies

Quick Setup

Add @pacely/company-search-module to the dev dependencies using yarn or npm to your project.

# Using npm
npm install @pacely/company-search-module

# Using yarn
yarn add @pacely/company-search-module

Add it to the buildModules section of your nuxt.config:

{
  buildModules: [
   '@pacely/company-search-module',
  ]
}

That's it, now you can use $companySearch in your Nuxt app

Usage

<template>
  <div>
    {{ JSON.stringify(company) }}
  </div>
</template>

<script lang="ts">
import { ParserInterface } from '@pacely/vatsearch'

export default {
    async asyncData ({ $companySearch }: { $companySearch: ParserInterface }) {
        const result = await $companySearch.get(996223698)

        return {
            company: result
        }
    },

    data () {
        return {
            company: {}
        }
    }
}
</script>

Available methods

// Fetch all companies (Currently only available in Norway (Brreg register)
this.$companySearch.all()

// Search for company by name
this.$companySearch.find('Disney World').then((companies: Company[]) => {
    console.log(companies) // [{ name: 'Disney World', employees: 3000, ...}, ...]
})

// Get a single company by it's VAT or business identifier
this.$companySearch.get(100010001).then((company: Company) => {
    console.log(company) // { name: 'Disney World', employees: 3000, ...}
})

Configuration

This package takes a single configuration while initializing. The register flag tells it what API to use for your request.

// nuxt.config.ts
export default {
    companySearch: {
        register: 'Brreg' // Brreg, Cvr, Ytj
    }
}

Available registers:

Name Companies
Brreg Norwegian companies
Cvr Danish companies
Ytj Swedish and Finnish companies

You can change the configuration afterwards by doing vatsearch.setOptions(options).

License

MIT License

Copyright (c) HIRVI AS

Package Sidebar

Install

npm i @pacely/company-search-module

Weekly Downloads

1

Version

1.1.4

License

MIT

Unpacked Size

9.05 kB

Total Files

10

Last publish

Collaborators

  • chrisrm