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

@sveltejs/adapter-node

Package Overview
Dependencies
Maintainers
4
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-node - npm Package Compare versions

Comparing version 1.0.0-next.85 to 1.0.0-next.86

files/handler-aee37ee5.js

4

files/handler.js

@@ -1,5 +0,5 @@

import './shims-ff515308.js';
import './shims-7fd472a1.js';
import 'fs';
import 'path';
export { h as handler } from './handler-393b2283.js';
export { h as handler } from './handler-aee37ee5.js';
import 'url';

@@ -6,0 +6,0 @@ import 'SERVER';

@@ -1,4 +0,4 @@

import { p as parse$1, e as env, h as handler } from './handler-393b2283.js';
import { p as parse$1, e as env, h as handler } from './handler-aee37ee5.js';
import http from 'http';
import './shims-ff515308.js';
import './shims-7fd472a1.js';
import 'assert';

@@ -5,0 +5,0 @@ import 'net';

@@ -1,2 +0,2 @@

import './shims-ff515308.js';
import './shims-7fd472a1.js';
import 'assert';

@@ -3,0 +3,0 @@ import 'net';

@@ -1,10 +0,4 @@

import { createReadStream, createWriteStream, existsSync, statSync, writeFileSync } from 'fs';
import { pipeline } from 'stream';
import glob from 'tiny-glob';
import { writeFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { promisify } from 'util';
import zlib from 'zlib';
const pipe = promisify(pipeline);
const files = fileURLToPath(new URL('./files', import.meta.url).href);

@@ -52,4 +46,4 @@

builder.log.minor('Compressing assets');
await compress(`${out}/client`);
await compress(`${out}/prerendered`);
await builder.compress(`${out}/client`);
await builder.compress(`${out}/prerendered`);
}

@@ -59,43 +53,1 @@ }

}
/**
* @param {string} directory
*/
async function compress(directory) {
if (!existsSync(directory)) {
return;
}
const files = await glob('**/*.{html,js,json,css,svg,xml,wasm}', {
cwd: directory,
dot: true,
absolute: true,
filesOnly: true
});
await Promise.all(
files.map((file) => Promise.all([compress_file(file, 'gz'), compress_file(file, 'br')]))
);
}
/**
* @param {string} file
* @param {'gz' | 'br'} format
*/
async function compress_file(file, format = 'gz') {
const compress =
format == 'br'
? zlib.createBrotliCompress({
params: {
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
[zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY,
[zlib.constants.BROTLI_PARAM_SIZE_HINT]: statSync(file).size
}
})
: zlib.createGzip({ level: zlib.constants.Z_BEST_COMPRESSION });
const source = createReadStream(file);
const destination = createWriteStream(`${file}.${format}`);
await pipe(source, compress, destination);
}
{
"name": "@sveltejs/adapter-node",
"version": "1.0.0-next.85",
"version": "1.0.0-next.86",
"repository": {

@@ -25,8 +25,5 @@ "type": "git",

],
"dependencies": {
"tiny-glob": "^0.2.9"
},
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@sveltejs/kit": "1.0.0-next.395",
"@sveltejs/kit": "1.0.0-next.405",
"@types/node": "^16.11.36",

@@ -33,0 +30,0 @@ "c8": "^7.11.3",

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