@pacely/company-search-module
v1.1.4
Published
This module makes sure your client data is correct and up-to-date. It also has risk management included.
Downloads
11
Maintainers
Readme
@pacely/vatsearch
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
Copyright (c) HIRVI AS