UNPKG

node-webplay

Version:

A nodejs streaming server implementation

46 lines (30 loc) 1.66 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _fs = require("fs"); var _fs2 = _interopRequireDefault(_fs); var _path = require("path"); var _path2 = _interopRequireDefault(_path); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var TestFile = function () { function TestFile(filepath) { _classCallCheck(this, TestFile); this._content = _fs2.default.readFileSync(filepath); this.size = this._content.length; this.name = _path2.default.basename(filepath); } _createClass(TestFile, [{ key: "slice", value: function slice(start, end) { var n = this._content.slice(start, end); //console.log('***>' , (typeof n), n.constructor.name); return n; } }]); return TestFile; }(); exports.default = TestFile; //# sourceMappingURL=file.js.map