UNPKG

tonic-example

Version:
30 lines (23 loc) 791 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = tonicExample; var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs); var _independent = require('independent'); var _independent2 = _interopRequireDefault(_independent); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function tonicExample(opts) { opts = opts || {}; var exampleCode = _fs2.default.readFileSync(opts.rawExamplePath, 'utf8'); (0, _independent2.default)({ code: exampleCode, path: opts.rawExamplePath }).then(function (tonicExample) { _fs2.default.writeFileSync(opts.tonicExamplePath, tonicExample, 'utf8'); }).catch(function (err) { throw err; }); } module.exports = exports['default'];