Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esmodule-server

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esmodule-server - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

lib/mimetype.d.ts

17

lib/cli.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var meta_1 = require("./meta");
var mimetype_1 = require("./mimetype");
var http = require("http2");
var fs = require("fs");
var filepath = require("path");
var chalk_1 = require("chalk");

@@ -36,3 +38,3 @@ var document_root_path = process.cwd();

_a[http.constants.HTTP2_HEADER_STATUS] = 404,
_a[http.constants.HTTP2_HEADER_CONTENT_TYPE] = 'text/plain; charset=utf-8',
_a[http.constants.HTTP2_HEADER_CONTENT_TYPE] = 'text/plain',
_a));

@@ -42,18 +44,11 @@ response.stream.end('Not found.');

else {
var mimetype = mimetype_1.default(filepath.extname(path));
console.debug('File', path);
console.debug('MimeType', mimetype);
response.stream.respondWithFile(path, (_b = {},
_b[http.constants.HTTP2_HEADER_STATUS] = 200,
_b[http.constants.HTTP2_HEADER_CONTENT_TYPE] = 'text/html; charset=utf-8',
_b[http.constants.HTTP2_HEADER_CONTENT_TYPE] = mimetype,
_b), { onError: function (error) { return console.error(error); } });
}
})
// .on('stream', (stream, headers) => {
// console.log(99)
// stream.respond({
// [http.constants.HTTP2_HEADER_STATUS]: 200,
// [http.constants.HTTP2_HEADER_CONTENT_TYPE]: 'text/html; charset=utf-8',
// })
// stream.on('error', (error) => console.error(error))
// stream.end('hello world!')
// })
.on('sessionError', function (error) {

@@ -60,0 +55,0 @@ console.error('Session Error', error);

{
"name": "esmodule-server",
"version": "0.1.0",
"version": "0.2.0",
"description": "ECMAScript-Module (ES Module) web server.",

@@ -14,3 +14,3 @@ "author": "Jumilla <fumio@jumilla.me>",

"bin": {
"esmc": "bin/esms.js"
"esms": "bin/esms.js"
},

@@ -44,3 +44,3 @@ "main": "lib/cli.js",

},
"gitHead": "2fc52a1da0116d4479444579676d5a79f185403c"
"gitHead": "ecc47493c51ec6fcb5c21c152cc1ddd4a138bc4e"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc