Back to home

example/

node

Version: 0.2.0

Last Updated: Unknown


Example Node

Takes name, age, whatever to generate markdown.

Module files

1#!/usr/bin/env node
2
3const dir = __dirname;
4const path = process.cwd();
5
6let filesErr = [];
7
8const build = ({ dependencies, data }) => {
9 dependencies.ejs.renderFile(`${dir}/template.ejs`, data, {}, function (
10 err,
11 str,
12 ) {
13 // str => Rendered HTML string
14 if (err) {
15 filesErr.push(data.filename);
16 throw err;
17 }
18
19 const outputFilePath = `${path}/manual/example/${data.filename}.md`;
20 dependencies.fs.outputFileSync(outputFilePath, str);
21 });
22};
23
24// somelib.js
25module.exports = function (options) {
26 console.log('Bridging Example');
27 try {
28 // const argv = dependencies.yargsParser(process.argv.slice(2));
29 console.log('\t - Scaffolding:', options.data.filename);
30 build(options);
31
32 return options;
33 } catch (err) {
34 console.error(err);
35 }
36};

Install


Lift generate


Repository

https://github.com/okeeffed/pkg-lift-example

Sections