@allcapsdev/gcp-cv-import

0.0.179 • Public • Published

gcp-cv-import

Description

Package to bulk import your GCP Cloud vision product set.

Dependabot Status npm Language grade: JavaScript Maintainability FOSSA Status

Usage

Install locally using npm

npm i -s @allcapsdev/gcp-cv-import

Then within your code:

import ImportProductSet from '@allcapsdev/gcp-cv-import';

const importPrdSet = new ImportProductSet({
  projectId: 'some-gcp-project',
  location: 'europe-west1',
  csvUri: 'gs://some-bucket/a-csv-file.csv'
});

const importResults = importPrdSet.import();

There is an optional argument that can be passed into new ImportProductSet which is, logger.

By default logger will use the standard console to log the results, however if you use something like winston or a custom logger, you can pass that in. The only stipulation is that it has to have a .info method.

ToDo

  • Handle errors better, the current approach just uses the errors provided from @google-cloud/vision - which aren't always that descriptive.

  • More tests & better mocking.

  • Improve the docs

Package Sidebar

Install

npm i @allcapsdev/gcp-cv-import

Weekly Downloads

2

Version

0.0.179

License

MIT

Unpacked Size

118 kB

Total Files

8

Last publish

Collaborators

  • matt-riley