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

vercel-deno-dev

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vercel-deno-dev - npm Package Compare versions

Comparing version 0.1.0-b502460c508a10a39f234dbe5984c6645e1455b2 to 0.1.0-b5dcd8bc2ade4c4f4ff1003655ac40ddfdd7d7cb

dist/boot/dev.runtime.ts

28

dist/boot/runtime.ts

@@ -52,2 +52,5 @@ import * as base64 from 'https://deno.land/x/base64/mod.ts';

const output = new Deno.Buffer();
output.grow(33554432); // Initialize memory size to 2^25 ~~ 33.5 MB
// Default buffer size: 4096 Bytes.
const req:NowRequest = new ServerRequest();

@@ -88,11 +91,10 @@ req.r = new BufReader(input);

// The actual output is raw HTTP message,
// so we will parse it
// - Headers ( statuscode default to 200 )
// - Message
const bufr = new BufReader(output);
// TODO: dynamically determine buffer size.
// output.length has a mismatch size of a few hundret bytes compared to boy.bytlength.
// not including size argument will make bufReader use default size 4096 Bytes.
// console.log({outlen:output.length})
const bufr = new BufReader(output,output.length);
const tp = new TextProtoReader(bufr);
const firstLine = await tp.readLine() || 'HTTP/1.1 200 OK'; // e.g. "HTTP/1.1 200 OK"
const firstLine = await tp.readLine() || 'HTTP/2.0 200 OK'; // e.g. "HTTP/1.1 200 OK"
const statuscode = res ? res.status || 200 : parseInt(firstLine.split(' ', 2)[1], 10); // get statuscode either from res or req.

@@ -105,6 +107,10 @@ const headers = await tp.readMIMEHeader() || new Headers();

let body = new Uint8Array(bufr.buffered());
let read = await bufr.readFull(body);
let buff = new Uint8Array(bufr.size());
const size = await bufr.read(buff)||bufr.size();
const body = buff.slice(0,size);
if (!body) throw new Deno.errors.UnexpectedEof();
// console.log({
// outlen:output.length,
// bodylen:body.byteLength,
// })
await req.finalize();

@@ -128,3 +134,3 @@

console.log("invoke Response")
console.log({result,context})
console.log({result})
const res = await LambdaFetch(`invocation/${context.awsRequestId}/response`, {

@@ -131,0 +137,0 @@ method: 'POST',

{
"name": "vercel-deno-dev",
"version": "0.1.0-b502460c508a10a39f234dbe5984c6645e1455b2",
"version": "0.1.0-b5dcd8bc2ade4c4f4ff1003655ac40ddfdd7d7cb",
"description": "run deno on vercel",

@@ -9,6 +9,4 @@ "main": "./dist/index",

"dependencies": {
"@vercel/build-utils": "^2.3.1",
"fs-extra": "^9.0.1",
"which": "^2.0.2",
"execa": "4.0.2"
"execa": "4.0.2",
"fs-extra": "^9.0.1"
},

@@ -20,5 +18,5 @@ "files": [

"devDependencies": {
"@vercel/build-utils": "^2.3.1",
"@types/fs-extra": "^9.0.1",
"@types/node": "^14.0.1",
"@types/which": "^1.3.2",
"@vercel/frameworks": "^0.0.14",

@@ -29,5 +27,7 @@ "@vercel/routing-utils": "^1.8.2",

"scripts": {
"build": "tsc && cp -R ./src/boot/ ./dist/boot/",
"test": "rmdir /s /q .\\test\\dist_ress\\ || tsc --project ./test/tsconfig.json && node ./test/dist_ress/test.js"
"clean": "if exist .\\dist\\ ( rmdir /s/q .\\dist\\ )",
"build:win": "tsc && (robocopy .\\src\\boot .\\dist\\boot\\ * /s) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0",
"build": "tsc && cp -R ./src/boot/. ./dist/boot/",
"publish:win": "npm run clean && npm run build:win"
}
}
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