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

@tinyhttp/send

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/send - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

dist/index.js.map

1

dist/index.d.ts

@@ -6,2 +6,1 @@ export * from './json.js';

export * from './sendFile.js';
//# sourceMappingURL=index.d.ts.map

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

import { parse, format } from "es-content-type";
import { parse, format } from "@tinyhttp/content-type";
import { eTag } from "@tinyhttp/etag";

@@ -6,3 +6,3 @@ import { Stats, statSync, createReadStream } from "node:fs";

import { isAbsolute, join, extname } from "node:path";
import { contentType } from "es-mime-types";
import mime from "mime";
const json = (res) => (body, ...args) => {

@@ -111,3 +111,3 @@ res.setHeader("Content-Type", "application/json");

if (!res.getHeader("Content-Type"))
headers["Content-Type"] = contentType(extname(path));
headers["Content-Type"] = mime.getType(extname(path)) + "; charset=utf-8";
let status2 = res.statusCode || 200;

@@ -148,1 +148,2 @@ if (req.headers["range"]) {

};
//# sourceMappingURL=index.js.map

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

/// <reference types="node" />
import { ServerResponse as S } from 'node:http';

@@ -9,2 +10,1 @@ type Res = Pick<S, 'setHeader' | 'end' | 'removeHeader'>;

export {};
//# sourceMappingURL=json.d.ts.map

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

/// <reference types="node" />
import type { IncomingMessage as I, ServerResponse as S } from 'node:http';

@@ -19,2 +20,1 @@ type Req = Pick<I, 'method'> & {

export {};
//# sourceMappingURL=send.d.ts.map

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

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import type { IncomingMessage as I, ServerResponse as S } from 'node:http';

@@ -39,2 +42,1 @@ export type ReadStreamOptions = Partial<{

export {};
//# sourceMappingURL=sendFile.d.ts.map

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

/// <reference types="node" />
import { IncomingMessage as I, ServerResponse as S } from 'node:http';

@@ -14,2 +15,1 @@ type Req = Pick<I, 'method'>;

export {};
//# sourceMappingURL=sendStatus.d.ts.map

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

/// <reference types="node" />
import type { ServerResponse } from 'node:http';

@@ -10,2 +11,1 @@ type Res = Pick<ServerResponse, 'statusCode'>;

export {};
//# sourceMappingURL=status.d.ts.map
import { Stats } from 'node:fs';
export declare const createETag: (body: Buffer | string | Stats, encoding: BufferEncoding) => string;
export declare function setCharset(type: string, charset: string): any;
//# sourceMappingURL=utils.d.ts.map
export declare function setCharset(type: string, charset: string): string;
{
"name": "@tinyhttp/send",
"version": "2.1.0",
"version": "2.2.0",
"type": "module",

@@ -30,4 +30,4 @@ "description": "json, send, sendFile, status and sendStatus methods for tinyhttp",

"dependencies": {
"es-content-type": "^0.1.0",
"es-mime-types": "^0.1.4",
"@tinyhttp/content-type": "^0.1.3",
"mime": "4.0.0-beta.1",
"@tinyhttp/etag": "2.1.0"

@@ -34,0 +34,0 @@ },

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