New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@circlesac/tsk

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@circlesac/tsk - npm Package Compare versions

Comparing version
0.0.1
to
26.3.0
+63
bin/install.js
import https from "https";
import fs from "fs";
import path from "path";
import { execSync } from "child_process";
import { fileURLToPath } from "url";
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const REPO = "circlesac/tsk-cli";
const PLATFORMS = {
"darwin-x64": { artifact: "tsk-darwin-x64", ext: ".tar.gz" },
"darwin-arm64": { artifact: "tsk-darwin-arm64", ext: ".tar.gz" },
"linux-x64": { artifact: "tsk-linux-x64", ext: ".tar.gz" },
"linux-arm64": { artifact: "tsk-linux-arm64", ext: ".tar.gz" },
};
function download(url) {
return new Promise((resolve, reject) => {
https.get(url, (res) => {
if (res.statusCode === 302 || res.statusCode === 301) {
return download(res.headers.location).then(resolve).catch(reject);
}
if (res.statusCode !== 200) return reject(new Error(`HTTP ${res.statusCode}`));
const chunks = [];
res.on("data", (c) => chunks.push(c));
res.on("end", () => resolve(Buffer.concat(chunks)));
res.on("error", reject);
});
});
}
const nativeDir = path.join(__dirname, "native");
const binPath = path.join(nativeDir, "tsk");
if (!fs.existsSync(binPath)) {
const { version } = require("../package.json");
if (version) {
const platform = `${process.platform}-${process.arch}`;
const info = PLATFORMS[platform];
if (!info) {
console.error(`Unsupported platform: ${platform}`);
process.exit(1);
}
const { artifact, ext } = info;
const url = `https://github.com/${REPO}/releases/download/v${version}/${artifact}${ext}`;
console.info(`Downloading tsk v${version} for ${platform}...`);
const data = await download(url);
fs.mkdirSync(nativeDir, { recursive: true });
const tmp = path.join(nativeDir, `tmp${ext}`);
fs.writeFileSync(tmp, data);
execSync(`tar xzf "${tmp}"`, { cwd: nativeDir });
fs.unlinkSync(tmp);
fs.chmodSync(binPath, 0o755);
console.info("Installed successfully.");
}
}
#!/bin/sh
set -e
REPO="circlesac/tsk-cli"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$OS-$ARCH" in
darwin-arm64) TARGET="tsk-darwin-arm64" ;;
darwin-x86_64) TARGET="tsk-darwin-x64" ;;
linux-aarch64) TARGET="tsk-linux-arm64" ;;
linux-x86_64) TARGET="tsk-linux-x64" ;;
*) echo "Unsupported platform: $OS-$ARCH"; exit 1 ;;
esac
VERSION=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)
URL="https://github.com/$REPO/releases/download/$VERSION/$TARGET.tar.gz"
echo "Installing tsk $VERSION..."
curl -fsSL "$URL" | tar xz -C "$INSTALL_DIR"
chmod +x "$INSTALL_DIR/tsk"
echo "Installed to $INSTALL_DIR/tsk"

Sorry, the diff of this file is not supported yet

+16
-11
{
"name": "@circlesac/tsk",
"description": "Circles Tasks — unified task management CLI",
"type": "module",
"bin": {
"tsk": "bin/tsk.mjs"
"tsk": "bin/tsk"
},
"dependencies": {
"citty": "^0.1.6",
"marklassian": "^1.2.0"
},
"description": "Circles Tasks — unified task management CLI",
"devDependencies": {
"bun-types": "^1.3.11"
},
"files": [
"bin"
],
"scripts": {},
"license": "MIT",
"name": "@circlesac/tsk",
"repository": {

@@ -17,9 +22,9 @@ "type": "git",

},
"devDependencies": {
"bun-types": "^1.3.11"
"scripts": {
"build": "bun build --compile --outfile=dist/tsk src/index.ts",
"dev": "bun run src/index.ts",
"postinstall": "node bin/install.js"
},
"dependencies": {
"marklassian": "^1.2.0"
},
"version": "0.0.1"
"type": "module",
"version": "26.3.0"
}
#!/usr/bin/env node
import { spawnSync } from "node:child_process";
import { existsSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ext = process.platform === "win32" ? ".exe" : "";
const bin = path.join(__dirname, "native", `tsk${ext}`);
if (!existsSync(bin)) {
await import("./install.js");
}
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
process.exit(result.status ?? 1);