kireerik/refo

Add command line support for the core package

kireerik opened this issue · 0 comments

#!/usr/bin/env node
const fs = require('fs')
, path = require('path')

, coreFileName = './refo.core'
, coreFile = path.resolve(fs.realpathSync(process.cwd()), coreFileName)
try {var core = require(coreFile)} catch (error) {}

const index = require('./index')

if (core)
	index(core.handlers, core.options)
else
	module.exports = index