Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

koop-provider-csv

2.0.0 • Public • Published

npm version Build Status

koop-provider-csv

A simple CSV provider for Koop

This provider works with a CSV file with coordinate columns (x and y).

Configuration

This provider uses config for configuration. The configuration files are within the config folder.

A configuration should look like this:

{
  // required:
  // 1. CSV source path, a local file path or a URL
  "source": "example.csv",
  // 2. service name
  "sourceName": "csv",
  // 3. coordinate column names
  "columns": {
    "x": "longitude",
    "y": "latitude"
  },
  // optional:
  // 1. delimiter
  "delimiter": ",",
  // 2. test server port
  "port": 8080
}
 

Test it out

Run server:

  • npm install
  • npm start

Tests:

  • npm test

Development output callstack logs

During development you can output error callstack with

  • NODE_ENV=test npm start

Deploy to AWS Lambda

Koop providers can be quickly deployed and scaled with AWS Lambda. To first create the service:

  • npm run lambda-create

To deploy code updates

  • npm run lambda-update

AWS Lambda configuration

By default, AWS Lambda has a 3 second timeout and only 128MB memory. If your Koop provider uses a slower service, then you should change the AWS Lambda timeout to a higher time limit (e.g. 60 seconds) as well as add more memory (e.g. 512MB).

With Docker

  • docker build -t koop-provider-sample .
  • docker run -it -p 8080:8080 koop-provider-sample

Keywords

none

install

npm i koop-provider-csv

Downloadsweekly downloads

1

version

2.0.0

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability