Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@koopjs/koop-core

Package Overview
Dependencies
Maintainers
7
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koopjs/koop-core

Serve, transform, and query geospatial data on the web

  • 7.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
508
increased by28.61%
Maintainers
7
Weekly downloads
 
Created
Source

Koop

Transform, query, & download geospatial data on the web. See koopjs.github.io for details.

npm version

This is the core dependency for setting up a Koop instance. By default it includes the Output-Geoservices plugin and an in-memory data cache.

Install

# Install Koop npm and save to package.json
npm install --save @koopjs/koop-core

Usage

The Koop usage docs and quick start provide usage information, but we'll give a quick overview here.

// require koop-core
const Koop = require('@koopjs/koop-core')

// create a Koop instance
const koop = new Koop(options)

/* Register Koop data providers */
const provider = require('@koopjs/provider-github')
koop.register(provider)


// Start listening on port 8080
koop.server.listen(8080, () => console.log(`Koop listening on port 8080!`))

Every Koop instance includes the Geoservice output-plugin by default, so after startup noted above, you would have the following routes ready to receive requests: [GET, POST] /github/rest/info [GET, POST] /github/rest/services/:id/FeatureServer/:layer/:method [GET, POST] /github/rest/services/:id/FeatureServer/layers [GET, POST] /github/rest/services/:id/FeatureServer/:layer [GET, POST] /github/rest/services/:id/FeatureServer

Options

You can pass an options object when instantiating a Koop instance.

// create a Koop instance
const koop = new Koop(options)
disableCors

Koop enables CORS by default. If you do not want CORS enabled, you can disable it by adding a disableCors boolean to your Koop config file:

const options = {
  disableCors: true
}
disableCompression

Koop adds Express compression by default. If you do not want Express compression (e.g., perhaps you are using Nginx for compression), you can disable it by adding a disableCompression boolean to your Koop config file:

const options = {
  disableCompression: true
}
logger

Koop includes a Winston logger with a console transport by default. If you have a custom logger that you want to use, you can pass it as an option:


const logger = require('my-logger')
const options = {
  logger
}
logLevel

The default Koop logger uses a log-level of info. If you want to change the log level, you can pass any of the standard Winston log-level values as an option:

const options = {
  logLevel: 'debug'
}

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

License

Apache 2.0

Keywords

FAQs

Package last updated on 24 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc