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

node-directus-client

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-directus-client

A JavaScript client for the Directus API

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Directus API JavaScript Client

A JavaScript client for the Directus API

This library is under active development. Breaking changes can occur at every patch.

Purpose

This libraries abstracts the interaction with the Directus CMS API. It enables your Node.js app to request specific resources from a Directus instance.

Installation

To use the library, install it with npm: npm install --save node-directus-client

Then require it in your application script: const DirectusClient = require('node-directus-client')

Usage

The module is a class, so you'll have to create a new instance of the client bound to the endpoint and access token of your Directus instance.

const cms = new DirectusClient({
  url: 'https://example.com/api/1/',
  key: 'abcdef12345'
});

Every method (see below) is asynchronous and can be used with callbacks as well as promises.

cms.tables()
  .then((res) => {
    console.log(res);
  });

cms.tables(function(err, res) {
  console.log(res);
});

Methods (endpoints)

The methods mimic the original Directus API endpoints as closely as possible.

Tables

cms.tables([raw = false, callback])

Gets all available tables.

Arguments:

  • raw: (bool) return the data as an Array of names or original Directus response

FAQs

Package last updated on 28 Oct 2016

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