Generate mock data for Metalsmith HTML templates
Last updated 4 years ago by robmcguinness .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install metalsmith-mock 
SYNC missed versions from official npm registry.


Generate mock data for Metalsmith HTML templates

License Dependency Status Linux Passing Windows Passing


  • Install metalsmith-mock with npm
  npm install metalsmith-mock --save-dev
  • Add data-mock attributes to html
<span data-mock="memberId:1"></span>
<span data-mock="customerId:1"></span>
  • Add metalsmith-mock plugin to metalsmith
const metalsmith = require('metlasmith');
const metalsmithMock = require('metalsmith-mock');


<span data-mock="memberId:1">981479716</span>
<span data-mock="customerId:1">6564503975</span>


<div data-mock="mock:identityKey"></div>

metalsmith-mock not only allows for the dynamic creation of mock data but also the reuse of the mock data identities throughout HTML templates.

When metalsmith-mock first encounters a data-mock attribute, it checks to see if that mock identity key has been previously defined and if so, uses that mock identify throughout all metalsmith templates.

If the mock identify key hasn't been previously defined, a new identify is created and cached in metal.metadata().mocks[identityKey] object.

Mock Options

  • fullName
  • fullNameReverse
  • sexShort
  • dob
  • memberId
  • customerId
  • groupNumber
  • addressLine1
  • addressLine2
  • sentence
  • sentences
  • paragraph
  • paragraphs
  • diagnosisType
  • procedureCode


Robert McGuinness


Open source software components distributed or made available in the Availity Materials are licensed to Company under the terms of the applicable open source license agreements, which may be found in text files included in the Availity Materials.

Copyright and license

Code and documentation copyright 2016 Availity, LLC. Code released under the MIT license.

Current Tags

  • 2.0.0                                ...           latest (4 years ago)

3 Versions

  • 2.0.0                                ...           4 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (5)
Dependents (0)

Copyright 2014 - 2017 © |