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

filesystem-sandbox

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filesystem-sandbox - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

3

dist/index.d.ts

@@ -35,2 +35,5 @@ /// <reference types="node" />

static create(at?: string): Promise<Sandbox>;
static setBaseTargetToCurrentWorkingDirectory(): Promise<void>;
static setBaseTargetToSystemTempFolder(): Promise<void>;
static setBaseTarget(to: string): Promise<void>;
}
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,2 +27,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const fs_1 = require("fs");
const os = __importStar(require("os"));
if (!fs_1.promises) {

@@ -49,2 +69,3 @@ throw new Error("Yer node is olde! filesystem-sandboxes requires a Node with fs.promises");

exports.basePrefix = "__sandboxes__";
let baseTarget = os.tmpdir();
const sandboxes = [];

@@ -54,3 +75,3 @@ class Sandbox {

this._at = at;
this._base = path_1.default.join(at || process.cwd(), exports.basePrefix);
this._base = path_1.default.join(at || baseTarget, exports.basePrefix);
this._path = path_1.default.join(this._base, uuid_1.v4());

@@ -160,3 +181,15 @@ mkdirp_1.sync(this._path);

}
static async setBaseTargetToCurrentWorkingDirectory() {
await this.setBaseTarget(process.cwd());
}
static async setBaseTargetToSystemTempFolder() {
await this.setBaseTarget(os.tmpdir());
}
static async setBaseTarget(to) {
if (!(await isFolder(to))) {
await mkdirp_1.sync(to);
}
baseTarget = to;
}
}
exports.Sandbox = Sandbox;

2

package.json
{
"name": "filesystem-sandbox",
"version": "1.11.0",
"version": "1.12.0",
"description": "JavaScript module to provide filesystem sandboxes for testing",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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