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

koa-simple-static

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-simple-static - npm Package Compare versions

Comparing version 4.0.11 to 4.1.1

15

lib/index.d.ts

@@ -1,9 +0,8 @@

import { Context } from 'koa';
declare type Next = () => Promise<void>;
declare type ExtraHeader = {
import { Middleware } from 'koa';
interface ExtraHeader {
[key: string]: string;
};
declare type Opts = {
}
interface Opts {
dir: string;
extraHeaders?: Array<ExtraHeader>;
extraHeaders?: ExtraHeader[];
cacheControl?: number;

@@ -13,4 +12,4 @@ maxAge?: number;

buffer?: boolean;
};
declare const simpleStatic: (options: Opts) => (ctx: Context, next: Next) => Promise<void>;
}
declare const simpleStatic: (options: Opts) => Middleware;
export default simpleStatic;
"use strict";
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -17,3 +18,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -50,18 +51,17 @@ if (y = 0, t) op = [op[0] & 2, t.value];

var fs_readdir_recursive_1 = __importDefault(require("fs-readdir-recursive"));
var zeelib_1 = require("zeelib");
var prefix = '/';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-function-return-type
var loadFile = function (name, dir, options, files) {
var pathname = path_1.normalize(path_1.join(prefix, name));
var pathname = (0, path_1.normalize)((0, path_1.join)(prefix, name));
var obj = (files[pathname] = files[pathname] ? files[pathname] : {});
var filename = (obj.path = path_1.join(dir, name));
var stats = fs_1.statSync(filename);
// eslint-disable-next-line node/prefer-global/buffer
var buffer = fs_1.readFileSync(filename);
var filename = (obj.path = (0, path_1.join)(dir, name));
var stats = (0, fs_1.statSync)(filename);
var buffer = (0, fs_1.readFileSync)(filename);
obj.cacheControl = options.cacheControl;
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
obj.maxAge = obj.maxAge ? obj.maxAge : options.maxAge || 0;
obj.type = obj.mime = mime_types_1.lookup(pathname) || 'application/octet-stream';
obj.type = obj.mime = (0, mime_types_1.lookup)(pathname) || 'application/octet-stream';
obj.mtime = stats.mtime;
obj.length = stats.size;
obj.md5 = crypto_1.createHash('md5').update(buffer).digest('base64');
obj.md5 = (0, crypto_1.createHash)('md5').update(buffer).digest('base64');
obj.buffer = buffer;

@@ -72,5 +72,5 @@ buffer = null;

var simpleStatic = function (options) {
var dir = path_1.normalize(options.dir);
var dir = (0, path_1.normalize)(options.dir);
var files = {};
fs_readdir_recursive_1.default(dir).forEach(function (name) {
(0, fs_readdir_recursive_1.default)(dir).forEach(function (name) {
loadFile(name, dir, options, files);

@@ -100,5 +100,3 @@ });

options.extraHeaders.forEach(function (header) {
// eslint-disable-next-line fp/no-loops, guard-for-in
for (var h in header) {
// eslint-disable-line guard-for-in
ctx.append(h, header[h]);

@@ -108,6 +106,6 @@ }

}
filename = zeelib_1.safeDecodeURIComponent(path_1.normalize(ctx.path));
filename = decodeURIComponent((0, path_1.normalize)(ctx.path));
file = files[filename];
if (!!file) return [3 /*break*/, 20];
if (!path_1.basename(filename).startsWith('.')) return [3 /*break*/, 6];
if (!(0, path_1.basename)(filename).startsWith('.')) return [3 /*break*/, 6];
return [4 /*yield*/, next()];

@@ -122,3 +120,3 @@ case 5:

_d.trys.push([7, 9, , 10]);
return [4 /*yield*/, fs_1.statSync(path_1.normalize(path_1.join(dir, filename + "/index.html"))).isFile()
return [4 /*yield*/, (0, fs_1.statSync)((0, path_1.normalize)((0, path_1.join)(dir, "".concat(filename, "/index.html")))).isFile()
/* eslint-enable @typescript-eslint/await-thenable */

@@ -128,3 +126,2 @@ ];

/* eslint-disable @typescript-eslint/await-thenable */
// @ts-ignore isFile is not in the types
hasIndex = _d.sent();

@@ -137,3 +134,3 @@ return [3 /*break*/, 10];

if (hasIndex) {
filename = filename + "/index.html";
filename = "".concat(filename, "/index.html");
}

@@ -143,3 +140,3 @@ if (filename.startsWith(path_1.sep)) {

}
fullPath = path_1.join(dir, filename);
fullPath = (0, path_1.join)(dir, filename);
if (!(!fullPath.startsWith(dir) && fullPath !== 'index.html')) return [3 /*break*/, 12];

@@ -155,3 +152,3 @@ return [4 /*yield*/, next()];

_d.trys.push([13, 15, , 17]);
return [4 /*yield*/, fs_1.statSync(path_1.join(dir, filename))];
return [4 /*yield*/, (0, fs_1.statSync)((0, path_1.join)(dir, filename))];
case 14:

@@ -180,3 +177,3 @@ // eslint-disable-next-line @typescript-eslint/await-thenable

if (!!file.buffer) return [3 /*break*/, 22];
return [4 /*yield*/, fs_1.statSync(file.path)];
return [4 /*yield*/, (0, fs_1.statSync)(file.path)];
case 21:

@@ -201,3 +198,4 @@ stats = _d.sent();

ctx.length = file.zipBuffer ? file.zipBuffer.length : file.length;
ctx.set('cache-control', "public, max-age=" + file.maxAge);
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
ctx.set('cache-control', "public, max-age=".concat(file.maxAge));
if (file.md5) {

@@ -220,7 +218,7 @@ ctx.set('content-md5', file.md5);

}
shouldGzip = file.length > 1024 && acceptGzip && compressible_1.default(file.type);
shouldGzip = file.length > 1024 && acceptGzip && (0, compressible_1.default)(file.type);
if (!file.buffer) return [3 /*break*/, 26];
if (!shouldGzip) return [3 /*break*/, 24];
_c = file;
return [4 /*yield*/, zlib_1.gzip(file.buffer)];
return [4 /*yield*/, (0, zlib_1.gzip)(file.buffer)];
case 23:

@@ -235,3 +233,3 @@ _c.zipBuffer = _d.sent();

case 25: return [2 /*return*/];
case 26: return [4 /*yield*/, fs_1.createReadStream(file.path)
case 26: return [4 /*yield*/, (0, fs_1.createReadStream)(file.path)
// update file hash

@@ -243,3 +241,3 @@ ];

if (!file.md5) {
hash_1 = crypto_1.createHash('md5');
hash_1 = (0, crypto_1.createHash)('md5');
stream.on('data', hash_1.update.bind(hash_1));

@@ -255,3 +253,3 @@ stream.on('end', function () {

ctx.set('content-encoding', 'gzip');
ctx.body = stream.pipe(zlib_1.createGzip());
ctx.body = stream.pipe((0, zlib_1.createGzip)());
}

@@ -258,0 +256,0 @@ return [2 /*return*/];

"use strict";
/* eslint-disable */
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -19,7 +20,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var textType = 'text/plain; charset=utf-8';
var correctStatus = function (s) { return "has " + s + " status"; };
var correctStatus = function (s) { return "has ".concat(s, " status"); };
var is200 = correctStatus(200);
var is404 = correctStatus(404);
var is304 = correctStatus(304);
var correctHeader = function (s) { return "has correct " + s; };
var correctHeader = function (s) { return "has correct ".concat(s); };
var correctCC = correctHeader('cache-control');

@@ -33,7 +34,7 @@ var correctCT = correctHeader('content-type');

var indexTs = path_1.default.resolve(dir, 'index.ts');
tape_1.default('it should accept abnormal path', function (t) {
(0, tape_1.default)('it should accept abnormal path', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('//index.ts')

@@ -49,7 +50,7 @@ .end(function (err, res) {

var etag;
tape_1.default('it should serve files', function (t) {
(0, tape_1.default)('it should serve files', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts')

@@ -70,5 +71,5 @@ .end(function (err, res) {

});
tape_1.default('it should serve files as buffers', function (t) {
(0, tape_1.default)('it should serve files as buffers', function (t) {
var app = new koa_1.default();
app.use(_1.default({
app.use((0, _1.default)({
dir: dir,

@@ -78,3 +79,3 @@ buffer: true,

var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts')

@@ -95,7 +96,7 @@ .end(function (err, res) {

});
tape_1.default('it should serve recursive files', function (t) {
(0, tape_1.default)('it should serve recursive files', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts')

@@ -115,7 +116,7 @@ .end(function (err, res) {

});
tape_1.default('it should not serve hidden files', function (t) {
(0, tape_1.default)('it should not serve hidden files', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/.gitignore')

@@ -130,7 +131,7 @@ .end(function (err, res) {

});
tape_1.default('it should support conditional HEAD requests', function (t) {
(0, tape_1.default)('it should support conditional HEAD requests', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.head('/index.ts')

@@ -146,7 +147,7 @@ .set('If-None-Match', etag)

});
tape_1.default('it should support conditional GET requests', function (t) {
(0, tape_1.default)('it should support conditional GET requests', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts')

@@ -162,7 +163,7 @@ .set('If-None-Match', etag)

});
tape_1.default('it should support HEAD', function (t) {
(0, tape_1.default)('it should support HEAD', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.head('/index.ts')

@@ -178,7 +179,7 @@ .end(function (err, res) {

});
tape_1.default('it should support 404 Not Found for other Methods to allow downstream', function (t) {
(0, tape_1.default)('it should support 404 Not Found for other Methods to allow downstream', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.put('/index.ts')

@@ -193,7 +194,7 @@ .end(function (err, res) {

});
tape_1.default('it should ignore query strings', function (t) {
(0, tape_1.default)('it should ignore query strings', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts?query=string')

@@ -208,9 +209,9 @@ .end(function (err, res) {

});
tape_1.default('it should set the etag and content-md5 headers', function (t) {
(0, tape_1.default)('it should set the etag and content-md5 headers', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
var index = fs_1.default.readFileSync(indexTs);
var md5 = crypto_1.default.createHash('md5').update(index).digest('base64');
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts')

@@ -222,3 +223,3 @@ .end(function (err, res) {

t.deepEqual(res.status, 200, is200);
t.equal(res.header['etag'], "\"" + md5 + "\"", correctET);
t.equal(res.header['etag'], "\"".concat(md5, "\""), correctET);
t.equal(res.header['content-md5'], md5, correctHeader('content-md5'));

@@ -228,7 +229,7 @@ t.end();

});
tape_1.default('it should serve files with gzip buffer', function (t) {
(0, tape_1.default)('it should serve files with gzip buffer', function (t) {
var filePath = path_1.default.resolve(dir, 'foo.txt');
fs_1.default.writeFileSync(filePath, 'hello world'.repeat(1000));
var app = new koa_1.default();
app.use(_1.default({
app.use((0, _1.default)({
dir: dir,

@@ -244,3 +245,3 @@ buffer: true,

}
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/foo.txt')

@@ -255,3 +256,3 @@ .set('Accept-Encoding', 'gzip')

t.equal(res.header['vary'], 'Accept-Encoding', correctV);
t.equal(res.header['content-length'], "" + content.length, correctCL);
t.equal(res.header['content-length'], "".concat(content.length), correctCL);
t.equal(res.header['content-encoding'], 'gzip', correctGZ);

@@ -269,5 +270,5 @@ t.equal(res.header['cache-control'], 'public, max-age=0', correctCC);

});
tape_1.default('it should not serve files with gzip buffer when accept encoding not include gzip', function (t) {
(0, tape_1.default)('it should not serve files with gzip buffer when accept encoding not include gzip', function (t) {
var app = new koa_1.default();
app.use(_1.default({
app.use((0, _1.default)({
dir: dir,

@@ -279,3 +280,3 @@ buffer: true,

var index = fs_1.default.readFileSync(indexTs);
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/index.ts')

@@ -291,3 +292,3 @@ .set('Accept-Encoding', '')

t.equal(res.header['cache-control'], 'public, max-age=0', correctCC);
t.equal(res.header['content-length'], "" + index.length, correctCL);
t.equal(res.header['content-length'], "".concat(index.length), correctCL);
t.notOk(res.header['content-encoding'], correctHeader('content-encoding'));

@@ -300,7 +301,7 @@ t.ok(res.header['content-length'], correctCL);

});
tape_1.default('it should serve files with gzip stream', function (t) {
(0, tape_1.default)('it should serve files with gzip stream', function (t) {
var filePath = path_1.default.resolve(dir, 'foo.txt');
fs_1.default.writeFileSync(filePath, 'hello world'.repeat(1000));
var app = new koa_1.default();
app.use(_1.default({
app.use((0, _1.default)({
dir: dir,

@@ -315,3 +316,3 @@ gzip: true,

}
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/foo.txt')

@@ -337,9 +338,9 @@ .set('Accept-Encoding', 'gzip')

});
tape_1.default('it should work fine when new file added', function (t) {
(0, tape_1.default)('it should work fine when new file added', function (t) {
var filePath = path_1.default.resolve(dir, 'a.js');
fs_1.default.writeFileSync(filePath, 'hello world');
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/a.js')

@@ -355,9 +356,9 @@ .end(function (err, res) {

});
tape_1.default('it should 404 when new hidden file added', function (t) {
(0, tape_1.default)('it should 404 when new hidden file added', function (t) {
var filePath = path_1.default.resolve(dir, '.a.js');
fs_1.default.writeFileSync(filePath, 'hello world');
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/.a.js')

@@ -373,7 +374,7 @@ .end(function (err, res) {

});
tape_1.default('it should 404 when file not exist', function (t) {
(0, tape_1.default)('it should 404 when file not exist', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/a.js')

@@ -388,7 +389,7 @@ .end(function (err, res) {

});
tape_1.default('it should 404 when is directory without index.html', function (t) {
(0, tape_1.default)('it should 404 when is directory without index.html', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/')

@@ -403,9 +404,9 @@ .end(function (err, res) {

});
tape_1.default('it should fall back to index.html if available', function (t) {
(0, tape_1.default)('it should fall back to index.html if available', function (t) {
var indexPath = path_1.default.resolve(dir, 'index.html');
fs_1.default.writeFileSync(indexPath, 'hello world');
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/')

@@ -422,7 +423,7 @@ .end(function (err, res) {

});
tape_1.default('it should not load files above options.dir', function (t) {
(0, tape_1.default)('it should not load files above options.dir', function (t) {
var app = new koa_1.default();
app.use(_1.default({ dir: dir }));
app.use((0, _1.default)({ dir: dir }));
var server = http_1.default.createServer(app.callback());
supertest_1.default(server)
(0, supertest_1.default)(server)
.get('/%2E%2E/package.json')

@@ -429,0 +430,0 @@ .end(function (err, res) {

@@ -1,165 +0,7 @@

GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2023 Zac Anger
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "koa-simple-static",
"description": "Simple caching static file server for Koa",
"version": "4.0.11",
"version": "4.1.1",
"author": {

@@ -14,3 +14,3 @@ "email": "zac@zacanger.com",

},
"license": "LGPL-3.0",
"license": "MIT",
"main": "lib/index.js",

@@ -29,3 +29,3 @@ "files": [

"test-server": "node test-server",
"test:lint": "eslint --ext .ts -c .eslintrc.json src",
"test:lint": "ts-standard src/*.ts",
"test:tape": "tape -r ts-node/register src/test.ts | tap-spec",

@@ -56,33 +56,28 @@ "test:ts": "tsc --noEmit"

"fs-readdir-recursive": "1.1.0",
"mime-types": "2.1.27",
"mime-types": "2.1.35",
"mz": "2.7.0",
"zeelib": "11.1.8"
"ts-standard": "12.0.2"
},
"devDependencies": {
"@types/compressible": "2.0.0",
"@types/fs-readdir-recursive": "1.0.0",
"@types/koa": "2.11.6",
"@types/mime-types": "2.1.0",
"@types/mz": "2.7.3",
"@types/node": "14.14.12",
"@types/supertest": "2.0.10",
"@types/tape": "4.13.0",
"eslint": "7.15.0",
"eslint-plugin-zacanger": "2.2.0",
"husky": "4.3.5",
"@types/fs-readdir-recursive": "1.1.0",
"@types/koa": "2.13.6",
"@types/mime-types": "2.1.1",
"@types/mz": "2.7.4",
"@types/node": "20.3.1",
"@types/supertest": "2.0.12",
"@types/tape": "5.6.0",
"istanbul": "0.4.5",
"koa": "2.13.0",
"lint-staged": "10.5.3",
"koa": "2.14.2",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"prettier": "2.2.1",
"sortpack": "2.1.11",
"supertest": "6.0.1",
"sortpack": "2.3.4",
"supertest": "6.3.3",
"tap-spec": "5.0.0",
"tape": "5.0.1",
"ts-node": "9.1.1",
"typescript": "4.1.3"
"tape": "5.6.3",
"ts-node": "10.9.1",
"typescript": "5.1.3"
},
"engines": {
"node": ">=12.0.0"
"node": ">=18.0.0"
},

@@ -106,16 +101,3 @@ "nyc": {

"sourceMap": true
},
"lint-staged": {
"*.ts": [
"prettier --write"
],
"package.json": [
"sortpack"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}

@@ -5,3 +5,3 @@ # Koa Simple Static

[![CircleCI](https://circleci.com/gh/zacanger/koa-simple-static.svg?style=svg)](https://circleci.com/gh/zacanger/koa-simple-static) [![codecov](https://codecov.io/gh/zacanger/koa-simple-static/branch/master/graph/badge.svg)](https://codecov.io/gh/zacanger/koa-simple-static) [![Maintainability](https://api.codeclimate.com/v1/badges/56ce56310829afe0d717/maintainability)](https://codeclimate.com/github/zacanger/koa-simple-static/maintainability) [![Known Vulnerabilities](https://snyk.io/test/github/zacanger/koa-simple-static/badge.svg)](https://snyk.io/test/github/zacanger/koa-simple-static) [![ko-fi](https://img.shields.io/badge/donate-KoFi-yellow.svg)](https://ko-fi.com/U7U2110VB) [![Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/zacanger) [![Support with PayPal](https://img.shields.io/badge/paypal-donate-yellow.png)](https://paypal.me/zacanger)
[![ko-fi](https://img.shields.io/badge/donate-KoFi-yellow.svg)](https://ko-fi.com/zacanger) [![Support with PayPal](https://img.shields.io/badge/paypal-donate-yellow.png)](https://paypal.me/zacanger)

@@ -8,0 +8,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