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 3.0.1 to 4.0.0

24

files/handler.js
import 'SHIMS';
import fs$1 from 'node:fs';
import fs$1, { createReadStream } from 'node:fs';
import path from 'node:path';

@@ -9,4 +9,5 @@ import * as fs from 'fs';

import { fileURLToPath } from 'node:url';
import { Readable } from 'node:stream';
import { Server } from 'SERVER';
import { manifest, prerendered } from 'MANIFEST';
import { manifest, prerendered, base } from 'MANIFEST';
import { env } from 'ENV';

@@ -1132,6 +1133,16 @@

/**
* Converts a file on disk to a readable stream
* @param {string} file
* @returns {ReadableStream}
* @since 2.4.0
*/
function createReadableStream(file) {
return /** @type {ReadableStream} */ (Readable.toWeb(createReadStream(file)));
}
/* global ENV_PREFIX */
const server = new Server(manifest);
await server.init({ env: process.env });
const origin = env('ORIGIN', undefined);

@@ -1153,2 +1164,9 @@ const xff_depth = parseInt(env('XFF_DEPTH', '1'));

const asset_dir = `${dir}/client${base}`;
await server.init({
env: process.env,
read: (file) => createReadableStream(`${asset_dir}/${file}`)
});
/**

@@ -1155,0 +1173,0 @@ * @param {string} path

@@ -42,4 +42,7 @@ import { readFileSync, writeFileSync } from 'node:fs';

`${tmp}/manifest.js`,
`export const manifest = ${builder.generateManifest({ relativePath: './' })};\n\n` +
`export const prerendered = new Set(${JSON.stringify(builder.prerendered.paths)});\n`
[
`export const manifest = ${builder.generateManifest({ relativePath: './' })};`,
`export const prerendered = new Set(${JSON.stringify(builder.prerendered.paths)});`,
`export const base = ${JSON.stringify(builder.config.kit.paths.base)};`
].join('\n\n')
);

@@ -90,4 +93,8 @@

});
},
supports: {
read: () => true
}
};
}

6

package.json
{
"name": "@sveltejs/adapter-node",
"version": "3.0.1",
"version": "4.0.0",
"description": "Adapter for SvelteKit apps that generates a standalone Node server",

@@ -35,3 +35,3 @@ "repository": {

"vitest": "^1.2.0",
"@sveltejs/kit": "^2.3.3"
"@sveltejs/kit": "^2.4.0"
},

@@ -45,3 +45,3 @@ "dependencies": {

"peerDependencies": {
"@sveltejs/kit": "^2.0.0"
"@sveltejs/kit": "^2.4.0"
},

@@ -48,0 +48,0 @@ "scripts": {

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