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

create-compas

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-compas - npm Package Compare versions

Comparing version 0.0.216 to 0.0.217

4

package.json
{
"name": "create-compas",
"version": "0.0.216",
"version": "0.0.217",
"description": "Create compas based applications",

@@ -18,3 +18,3 @@ "exports": {

"dependencies": {
"@compas/stdlib": "0.0.216",
"@compas/stdlib": "0.0.217",
"tar": "6.1.11"

@@ -21,0 +21,0 @@ },

@@ -0,7 +1,9 @@

import { createWriteStream } from "fs";
import { mkdir, readFile, writeFile } from "fs/promises";
import https from "https";
import os from "os";
import { normalize } from "path";
import { Readable } from "stream";
import { pipeline } from "stream/promises";
import { AppError, environment, exec, pathJoin, spawn } from "@compas/stdlib";
import { AppError, environment, exec, pathJoin, spawn, uuid } from "@compas/stdlib";
import tar from "tar";

@@ -83,3 +85,4 @@

let stream = Readable.from(Buffer.from(""));
const tmpFile = pathJoin(os.tmpdir(), `create-compas-${uuid()}`);
let httpStream = Readable.from(Buffer.from(""));

@@ -90,3 +93,3 @@ if (options.template.provider === "github") {

// @ts-expect-error
stream = await templateGetHttpStream(
httpStream = await templateGetHttpStream(
`https://codeload.github.com/${options.template.repository}/tar.gz${

@@ -98,2 +101,5 @@ options.template.ref ? `/${options.template.ref}` : ""

logger.info("Downloading template...");
await pipeline(httpStream, createWriteStream(tmpFile));
let dirToExtract = options.template.path;

@@ -119,15 +125,13 @@

logger.info(`Downloading and extracting template...`);
logger.info(`Extracting template...`);
await pipeline(
stream,
tar.extract(
{
cwd: options.outputDirectory,
strip: options.template.path
? normalize(options.template.path).split("/").length + 1
: 1,
},
[dirToExtract],
),
await tar.extract(
{
file: tmpFile,
cwd: options.outputDirectory,
strip: options.template.path
? normalize(options.template.path).split("/").length + 1
: 1,
},
[dirToExtract],
);

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