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

get-uri

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-uri - npm Package Compare versions

Comparing version 6.0.3 to 6.0.4

4

./dist/index.js

@@ -33,6 +33,6 @@ "use strict";

* `getUri()` call as a `cache: stream` option, and if the destination has
* not changed since the last time the endpoint was retreived then the callback
* not changed since the last time the endpoint was retrieved then the callback
* will be invoked with an Error object with `code` set to "ENOTMODIFIED" and
* `null` for the "stream" instance argument. In this case, you can skip
* retreiving the file again and continue to use the previous payload.
* retrieving the file again and continue to use the previous payload.
*

@@ -39,0 +39,0 @@ * @param {String} uri URI to retrieve

@@ -9,3 +9,2 @@ "use strict";

const fs_1 = require("fs");
const fs_extra_1 = require("fs-extra");
const notfound_1 = __importDefault(require("./notfound"));

@@ -27,6 +26,7 @@ const notmodified_1 = __importDefault(require("./notmodified"));

// exists.
const fd = await (0, fs_extra_1.open)(filepath, flags, mode);
// Now `fstat()` to check the `mtime` and store the stat object for
// the cache.
const stat = await (0, fs_extra_1.fstat)(fd);
const fdHandle = await fs_1.promises.open(filepath, flags, mode);
// extract the numeric file descriptor
const fd = fdHandle.fd;
// store the stat object for the cache.
const stat = await fdHandle.stat();
// if a `cache` was provided, check if the file has not been modified

@@ -38,4 +38,3 @@ if (cache && cache.stat && stat && isNotModified(cache.stat, stat)) {

// fd after it's done reading
// @ts-expect-error `@types/node` doesn't allow `null` as file path :/
const rs = (0, fs_1.createReadStream)(null, {
const rs = (0, fs_1.createReadStream)(filepath, {
autoClose: true,

@@ -42,0 +41,0 @@ ...opts,

@@ -27,6 +27,6 @@ /// <reference types="node" />

* `getUri()` call as a `cache: stream` option, and if the destination has
* not changed since the last time the endpoint was retreived then the callback
* not changed since the last time the endpoint was retrieved then the callback
* will be invoked with an Error object with `code` set to "ENOTMODIFIED" and
* `null` for the "stream" instance argument. In this case, you can skip
* retreiving the file again and continue to use the previous payload.
* retrieving the file again and continue to use the previous payload.
*

@@ -33,0 +33,0 @@ * @param {String} uri URI to retrieve

@@ -33,6 +33,6 @@ "use strict";

* `getUri()` call as a `cache: stream` option, and if the destination has
* not changed since the last time the endpoint was retreived then the callback
* not changed since the last time the endpoint was retrieved then the callback
* will be invoked with an Error object with `code` set to "ENOTMODIFIED" and
* `null` for the "stream" instance argument. In this case, you can skip
* retreiving the file again and continue to use the previous payload.
* retrieving the file again and continue to use the previous payload.
*

@@ -39,0 +39,0 @@ * @param {String} uri URI to retrieve

{
"name": "get-uri",
"version": "6.0.3",
"version": "6.0.4",
"description": "Returns a `stream.Readable` from a URI string",

@@ -33,3 +33,2 @@ "main": "./dist/index.js",

"@types/debug": "^4.1.7",
"@types/fs-extra": "^8.1.2",
"@types/ftpd": "^0.2.35",

@@ -41,3 +40,3 @@ "@types/jest": "^29.5.1",

"jest": "^29.5.0",
"st": "^1.2.2",
"st": "^3.0.0",
"ts-jest": "^29.1.0",

@@ -50,4 +49,3 @@ "typescript": "^5.0.4",

"data-uri-to-buffer": "^6.0.2",
"debug": "^4.3.4",
"fs-extra": "^11.2.0"
"debug": "^4.3.4"
},

@@ -54,0 +52,0 @@ "engines": {

@@ -58,3 +58,3 @@ get-uri

supports sending an indicator that the remote resource has not been modified
since the last time it has been retreived from that node process.
since the last time it has been retrieved from that node process.

@@ -61,0 +61,0 @@ To do this, define a `cache` property on the "options object" argument

Sorry, the diff of this file is not supported yet

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