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

@llamaindex/env

Package Overview
Dependencies
Maintainers
5
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@llamaindex/env - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

dist/cjs/fs/memfs/index.js

11

CHANGELOG.md
# @llamaindex/env
## 0.1.3
### Patch Changes
- e072c45: fix: remove non-standard API `pipeline`
- 9e133ac: refactor: remove `defaultFS` from parameters
We don't accept passing fs in the parameter since it's unnecessary for a determined JS environment.
This was a polyfill way for the non-Node.js environment, but now we use another way to polyfill APIs.
## 0.1.2

@@ -4,0 +15,0 @@

25

dist/cjs/index.js

@@ -45,4 +45,4 @@ /**

},
defaultFS: function() {
return defaultFS;
fs: function() {
return _node.fs;
},

@@ -58,5 +58,2 @@ getEnv: function() {

},
pipeline: function() {
return _promises1.pipeline;
},
randomUUID: function() {

@@ -71,7 +68,6 @@ return _nodecrypto.randomUUID;

const _nodecrypto = require("node:crypto");
const _promises = /*#__PURE__*/ _interop_require_default(require("node:fs/promises"));
const _nodeos = require("node:os");
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
const _promises1 = require("node:stream/promises");
const _web = require("node:stream/web");
const _node = require("./fs/node.js");
const _utils = require("./utils.js");

@@ -94,16 +90,1 @@ function _interop_require_default(obj) {

}
const defaultFS = {
writeFile: function(path, content) {
return _promises.default.writeFile(path, content, "utf-8");
},
readRawFile (path) {
return _promises.default.readFile(path);
},
readFile: function(path) {
return _promises.default.readFile(path, "utf-8");
},
access: _promises.default.access,
mkdir: _promises.default.mkdir,
readdir: _promises.default.readdir,
stat: _promises.default.stat
};

@@ -18,3 +18,3 @@ /**

const _utils = require("./utils.js");
_export_star(require("./index.polyfill.js"), exports);
_export_star(require("./polyfill.js"), exports);
function _export_star(from, to) {

@@ -21,0 +21,0 @@ Object.keys(from).forEach(function(k) {

@@ -15,7 +15,6 @@ /**

import { createHash, randomUUID } from "node:crypto";
import fs from "node:fs/promises";
import { EOL } from "node:os";
import path from "node:path";
import { pipeline } from "node:stream/promises";
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
import { fs } from "./fs/node.js";
export function createSHA256() {

@@ -32,18 +31,3 @@ const hash = createHash("sha256");

}
export const defaultFS = {
writeFile: function(path, content) {
return fs.writeFile(path, content, "utf-8");
},
readRawFile (path) {
return fs.readFile(path);
},
readFile: function(path) {
return fs.readFile(path, "utf-8");
},
access: fs.access,
mkdir: fs.mkdir,
readdir: fs.readdir,
stat: fs.stat
};
export { AsyncLocalStorage, CustomEvent, getEnv, setEnvs } from "./utils.js";
export { EOL, ReadableStream, TransformStream, WritableStream, ok, path, pipeline, randomUUID };
export { EOL, ReadableStream, TransformStream, WritableStream, fs, ok, path, randomUUID };

@@ -8,5 +8,5 @@ /**

*/ import { INTERNAL_ENV } from "./utils.js";
export * from "./index.polyfill.js";
export * from "./polyfill.js";
export function getEnv(name) {
return INTERNAL_ENV[name];
}

@@ -6,3 +6,2 @@ /// <reference types="node" resolution-mode="require"/>

/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/**

@@ -25,10 +24,7 @@ * This module is under Node.js environment.

import path from "node:path";
import { pipeline } from "node:stream/promises";
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
import type { SHA256 } from "./index.polyfill.js";
import type { CompleteFileSystem } from "./type.js";
import { fs } from "./fs/node.js";
import type { SHA256 } from "./polyfill.js";
export declare function createSHA256(): SHA256;
export declare const defaultFS: CompleteFileSystem;
export type * from "./type.js";
export { AsyncLocalStorage, CustomEvent, getEnv, setEnvs } from "./utils.js";
export { EOL, ReadableStream, TransformStream, WritableStream, ok, path, pipeline, randomUUID, };
export { EOL, ReadableStream, TransformStream, WritableStream, fs, ok, path, randomUUID, };

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

export * from "./index.polyfill.js";
export * from "./polyfill.js";
export declare function getEnv(name: string): string | undefined;
{
"name": "@llamaindex/env",
"description": "environment wrapper, supports all JS environment including node, deno, bun, edge runtime, and cloudflare worker",
"version": "0.1.2",
"version": "0.1.3",
"type": "module",

@@ -36,4 +36,4 @@ "types": "dist/type/index.d.ts",

"edge-light": {
"types": "./dist/type/index.polyfill.d.ts",
"default": "./dist/index.polyfill.js"
"types": "./dist/type/index.edge-light.d.ts",
"default": "./dist/index.edge-light.js"
},

@@ -48,12 +48,2 @@ "import": {

}
},
"./*": {
"import": {
"types": "./dist/type/*.d.ts",
"default": "./dist/*.js"
},
"require": {
"types": "./dist/type/*.d.ts",
"default": "./dist/cjs/*.js"
}
}

@@ -72,16 +62,15 @@ },

"@aws-crypto/sha256-js": "^5.2.0",
"@swc/cli": "^0.3.9",
"@swc/core": "^1.4.2",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.5.5",
"concurrently": "^8.2.2",
"pathe": "^1.1.2",
"readable-stream": "^4.5.2"
"vitest": "^1.6.0"
},
"dependencies": {
"@types/lodash": "^4.14.202",
"@types/node": "^20.12.7"
"@types/lodash": "^4.17.1",
"@types/node": "^20.12.11"
},
"peerDependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"pathe": "^1.1.2",
"readable-stream": "^4.5.2"
"pathe": "^1.1.2"
},

@@ -94,5 +83,2 @@ "peerDependenciesMeta": {

"optional": true
},
"readable-stream": {
"optional": true
}

@@ -106,4 +92,6 @@ },

"postbuild": "node -e \"require('fs').writeFileSync('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }))\"",
"dev": "concurrently \"pnpm run build:esm --watch\" \"pnpm run build:cjs --watch\" \"pnpm run build:type --watch\""
"dev": "concurrently \"pnpm run build:esm --watch\" \"pnpm run build:cjs --watch\" \"pnpm run build:type --watch\"",
"circular-check": "madge -c ./src/index.ts",
"test": "vitest"
}
}

Sorry, the diff of this file is not supported yet

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