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

@frctl/adapters

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frctl/adapters

Work-in-progress template engine adapters for Fractal v2

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

Fractal template engine adapters

Work-in-progress template engine adapters for Fractal v2.

Build Status NPM Version

Overview

This repository contains a collection of template engine adapters for Fractal that can be used to render HTML output of component view files.

The currently available adapters are:

  • React
  • Nunjucks
  • Handlebars

const fractal = require('@frctl/fractal');
const adapters = require('@frctl/adapters');

const parser = fractal({
  src: './path/to/components',
  adapters: [
    adapters.nunjucks
  ]
});

parser.parse(function(err, components) {
  if (err) {
    return console.log(err);
  }

  const component = components.find({
    name: 'button'
  });
  const view = component.files.find({
    role: 'view',
    adapter: 'nunjucks'
  }); // get the nunjucks template for the 'button' component

  components.renderView(view, {label: 'Click me!'}, function(err, html){
    console.log(html);
  });

});

Installation

The adapters in this repository are included with Fractal by default so do not need to be installed manually.

However, the underlying template engines do need to be installed in your project before the corresponding adapter can be used.

Nunjucks

npm i nunjucks --save

Handlebars

npm i handlebars --save

React

npm i react react-dom babel-register babel-preset-es2015 babel-preset-react --save

Requirements

Node >= v6.0 is required.

Keywords

FAQs

Package last updated on 28 Apr 2017

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