Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@freestyle-sh/with-python

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@freestyle-sh/with-python - npm Package Compare versions

Comparing version
0.2.0
to
0.2.1
+3
-3
dist/index.d.ts

@@ -1,2 +0,2 @@

import { VmWith, VmWithInstance, CreateVmOptions } from 'freestyle-sandboxes';
import { VmWith, VmWithInstance, VmSpec } from 'freestyle-sandboxes';
import { VmRunCodeInstance, JSONValue, RunCodeResponse, VmRunCode } from '@freestyle-sh/with-type-run-code';

@@ -6,3 +6,3 @@

constructor();
configure(existingConfig: CreateVmOptions): CreateVmOptions | Promise<CreateVmOptions>;
configureSnapshotSpec(spec: VmSpec): VmSpec;
createInstance(): PythonRuntimeInstance;

@@ -13,3 +13,3 @@ }

constructor(builder: VmPython);
runCode<Result extends JSONValue = any>({ code, }: {
runCode<Result extends JSONValue = any>(args: string | {
code: string;

@@ -16,0 +16,0 @@ }): Promise<RunCodeResponse<Result>>;

@@ -1,2 +0,2 @@

import { VmWith, VmTemplate, VmWithInstance } from 'freestyle-sandboxes';
import { VmWith, VmSpec, VmWithInstance } from 'freestyle-sandboxes';

@@ -7,9 +7,9 @@ class VmPython extends VmWith {

}
configure(existingConfig) {
const pythonConfig = {
template: new VmTemplate({
configureSnapshotSpec(spec) {
return this.composeSpecs(
spec,
new VmSpec({
aptDeps: ["python3"]
})
};
return this.compose(existingConfig, pythonConfig);
);
}

@@ -26,5 +26,4 @@ createInstance() {

}
async runCode({
code
}) {
async runCode(args) {
const code = typeof args === "string" ? args : args.code;
const result = await this.vm.exec({

@@ -31,0 +30,0 @@ command: `python3 -c "${code.replace(/"/g, '\\"')}"`

{
"name": "@freestyle-sh/with-python",
"version": "0.2.0",
"version": "0.2.1",
"private": false,
"dependencies": {
"freestyle-sandboxes": "^0.1.2",
"@freestyle-sh/with-type-run-code": "^0.2.0"
"freestyle-sandboxes": "^0.1.8",
"@freestyle-sh/with-type-run-code": "^0.2.1"
},

@@ -9,0 +9,0 @@ "type": "module",