Socket
Socket
Sign inDemoInstall

druxt

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

druxt

A Bridge between frameworks, Nuxt.js in the front, Drupal in the back.


Version published
Weekly downloads
449
increased by14.25%
Maintainers
1
Weekly downloads
 
Created
Source

DruxtJS; A bridge between frameworks.

npm CircleCI Known Vulnerabilities codecov

DruxtJS provides an easy connection between a Drupal JSON:API backend and Nuxt.js frontend application.

Install

$ npm install druxt

Usage

Drupal JSON:API client

Two methods of communication with the Drupal JSON:API are provided by Druxt, a framework agnostic DruxtClient and the DruxtStore Vuex module, which adds an additional cache layer.

Example:

const { DruxtClient } = require('druxt')
new DruxtClient('https://demo-api.druxtjs.org')
  .getCollection('node--page')
  .then((res) => {
    // Do the thing!
  })

Get started with the Guide and API Documentation.

Nuxt Module / Plugin

The Nuxt module adds the Vue components, Vuex store and DruxtClient plugin to your Nuxt application.

Add module to nuxt.config.js

module.exports = {
  modules: ['druxt'],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org'
  }
}

The $druxt plugin gives your Nuxt application access to the DruxtClient.

Example:

<script>
export default {
  async fetch() {
    this.page = await this.$druxt.getResource({
      type: 'node--page',
      id: 'd8dfd355-7f2f-4fc3-a149-288e4e293bdd',
    })
  },
  data: () => ({ page: null }),
}
</script>

Themable modules

Druxt uses a Module and slot-based Wrapper component system, making it easy to render and theme Drupal data.

Find more details in the Guide

Community support

Druxt is an open source project, built by the comunity for the community.

Find support or get involved in building Druxt via the community channels:

Fully decoupled Drupal sites

The DruxtSite module provides minimal configuration, decoupled Drupal site functionality.

Try out the Umami demo, or checkout the source for the Nuxt.js frontend and the Drupal 9 backend.

Keywords

FAQs

Package last updated on 19 May 2021

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