metalsmith-mock

2.0.0 • Public • Published

metalsmith-mock

Generate mock data for Metalsmith HTML templates

License Dependency Status Linux Passing Windows Passing

Quickstart

  • 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');
metalsmith(__dirname)
  .use(metalsmithMock())
  .build();

Output

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

API

<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

Authors

Robert McGuinness

Disclaimer

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    4
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i metalsmith-mock

Weekly Downloads

4

Version

2.0.0

License

MIT

Last publish

Collaborators

  • lauroxx
  • dznjudo
  • availity-cicd-bot
  • azeigler
  • dnoler
  • jselden
  • cbaker1
  • twarner
  • gregmartdotin
  • hnicbaker
  • chrishavekost
  • jordan-a-young
  • robmcguinness