UNPKG

jayvfs

Version:

virtual file system in node-js

16 lines (13 loc) 323 B
const jvfs = require('../jvfs'); let cat = function(tarNode) { if (!tarNode) { return 'cat: missing file operand'; } try { let file = jvfs.getFile(tarNode); return file.contents; } catch (e) { return 'cat: \'' + tarNode + '\': ' + e.message; } }; module.exports = cat;