Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@pkyeck/ckan-ts
Advanced tools
A fully tested TypeScript wrapper for CKAN API endpoints, designed to provide coherent vocabulary & outputs, regardless of implementation
ckan-ts is a fully tested and documented TypeScript wrapper for retrieving data from v3 CKAN APIs asynchronously. Its main aim is to provide parsed outputs using a coherent and consistent vocabulary across all resource types, and handle non-standard data provided by different organizations.
Install ckan-ts with npm i ckan-ts
or yarn add ckan-ts
.
Using ckan-ts is very simple. For instance, the following checks whether or not a site is functional, and retrieves its first 100 datasets if it is:
import CKAN from "ckan-ts";
const parser = new CKAN("https://demo.ckan.org/api/3/");
const isAvailable = await parser.available();
if(isAvailable){
const datasets = await parser.datasets({limit: 100});
}
For the most part, ckan-ts is intended to retrieve data from unauthenticated endpoints. However, you can also pass it headers to use throughout, i.e.
const parser = new CKAN("https://demo.ckan.org/api/3/", {
requestOptions: {
headers: {} // the desired http headers go here
}
});
Currently supported methods:
Search:
.autocompleteDataset(query, limit)
: searches for a dataset, and returns its autocomplete results..autocompleteFormat(query, limit)
: searches for a file format, and returns its autocomplete results..autocompleteGroup(query, limit)
: searches for a group, and returns its autocomplete results..autocompleteOrganization(query, limit)
: searches for an organization, and returns its autocomplete results..autocompleteTag(query, limit)
: searches for a tag, and returns its autocomplete results..autocompleteUser(query, limit)
: searches for a user, and returns its autocomplete results.searchDataset(query, options)
: searches for a given dataset with additional options, and returns its details..searchResource(query, options)
: searches for a given resource with additional options, and returns its detaisl.Lists:
.datasets(settings?)
: returns the IDs of all datasets on the server..detailedDatasets(settings?)
: returns information about all datasets on the server, including their included resources..detailedGroups(settings?)
: returns information about all groups on the server..detailedOrganizations(settings?)
: returns information about all organizations on the server..detailedTags(settings?)
: returns information about all tags on the server..detailedUsers(settings?)
: returns a list of users on the server with detailed information..groups(settings?)
: returns the IDs of all groups on the server..licenses()
: returns all the licenses used across datasets..organizations(settings?)
: returns the IDs of all organizations on the server..tags(settings?)
: returns the name of all tags on the server..users(settings?)
: returns a list of user IDs on the server..vocabularies()
: returns a list of vocabularies on the server.Single items:
.dataset(id)
: returns the metadata of a dataset with a given ID..group(id, settings?)
: returns information pertaining to a group..organization(id, settings?)
: returns information pertaining to an organization..resource(id)
: returns the metadata of a resource with a given ID..user(id)
: returns information about a given user..vocabulary(id)
: returns information about a given vocabulary.Miscellaneous:
.action(action, data?, method?)
: carries out a generic action. Used in case it has not been implemented in the CKAN-TS yet..available()
: checks whether an API endpoint is currently available.For more information about these methods, check the documentation.
ckan-ts is released under the MIT license. For more information, see the LICENSE file.
FAQs
A fully tested TypeScript wrapper for CKAN API endpoints, designed to provide coherent vocabulary & outputs, regardless of implementation
We found that @pkyeck/ckan-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.