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

@bam.tech/parcel-plugin-handlebars-mock

Package Overview
Dependencies
Maintainers
12
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bam.tech/parcel-plugin-handlebars-mock

Parcel plugin to populate html during development.

  • 2.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
12
Created
Source

@bam.tech/parcel-plugin-handlebars-mock

Populate HTML file with mock data in development. It also let you register helper methods for handlebars

Installation

yarn add @bam.tech/parcel-plugin-handlebars-mock

Usage

Mock data

  • Create a src/mock directory.
  • For each html file (named foo.html for example), create a src/mock/foo.html.js with the mock content:
module.exports = {
  bar: 'baz',
};
  • If NODE_ENV is production, then the plugin is not applied.

Register helper methods

  • create a src/helper directory with an index.js that register some templates
const Handlebars = require('handlebars');

Handlebars.registerHelper('isArrayBig', (array) => {
  return array.length > 3;
});

FAQs

Package last updated on 01 Jun 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