Skip to content

Commit

Permalink
Merge pull request #131 from NodeSecure/update-deps
Browse files Browse the repository at this point in the history
Update package dependencies
  • Loading branch information
fraxken authored Mar 19, 2024
2 parents 8586850 + 4703701 commit b8b6cd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// Import Node.js Dependencies
import * as fs from "node:fs/promises";
import * as path from "node:path";
import { createWriteStream, createReadStream } from "node:fs";
import fs from "node:fs/promises";
import path from "node:path";
import { createGunzip } from "node:zlib";
import { pipeline } from "node:stream/promises";

// Import Third-party Dependencies
import tar from "tar-fs";
import httpie from "@myunisoft/httpie";
import * as dotenv from "dotenv";
dotenv.config();

// CONSTANTS
const kGithubURL = new URL("https://github.com/");
Expand Down Expand Up @@ -37,14 +35,15 @@ export async function download(repository, options = Object.create(null)) {
const repositoryURL = new URL(`${organization}/${repo}/archive/${branch}.tar.gz`, kGithubURL);
const location = path.join(dest, `${repo}-${branch}.tar.gz`);

await httpie.stream("GET", repositoryURL, {
const writableCallback = httpie.stream("GET", repositoryURL, {
headers: {
"User-Agent": "NodeSecure",
"Accept-Encoding": "gzip, deflate",
Authorization: typeof token === "string" ? `token ${token}` : GITHUB_TOKEN
},
maxRedirections: 1
})(createWriteStream(location));
});
await writableCallback(() => createWriteStream(location));

return {
location,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
},
"homepage": "https://github.com/NodeSecure/github#readme",
"dependencies": {
"@myunisoft/httpie": "^1.10.0",
"tar-fs": "^2.1.1"
"@myunisoft/httpie": "^4.0.1",
"tar-fs": "^3.0.5"
},
"devDependencies": {
"@nodesecure/eslint-config": "^1.5.0",
"@nodesecure/eslint-config": "^1.9.0",
"@slimio/is": "^2.0.0",
"c8": "^9.1.0",
"dotenv": "^16.0.2",
Expand Down

0 comments on commit b8b6cd6

Please sign in to comment.