

@vscode-utility/fs-browserify
When developing vscode extensions, it is essential to ensure compatibility between the desktop and web versions of vscode (https://vscode.dev or https://github.dev).
Using @vscode-utility/fs-browserify
, you can access and manipulate files stored locally or remotely, making it easier to develop vscode extensions that work seamlessly on both the desktop and web versions of vscode.
If you find this package useful for your projects, please consider supporting me by Buy Me a Coffee. It's a great way to help me maintain and improve this package in the future. Your support is truly appreciated!
Installation
npm
npm install @vscode-utility/fs-browserify
yarn
yarn add @vscode-utility/fs-browserify
pnpm
pnpm add @vscode-utility/fs-browserify
Usage
import { fs } from '@vscode-utility/fs-browserify';
const fileStat = await fs.statAsync(path);
console.log(fileStat);
const fileContent = await fs.readFileAsync(path);
console.log(fileContent);
Compare functions
@vscode-utility/fs-browserify | fs (nodejs) |
---|
fs.statAsync() | fs.stat() |
fs.readDirectoryAsync() | fs.readDir() |
fs.createDirectoryAsync() | fs.mkdir() |
fs.readFileAsync() | fs.readFile() |
fs.appendFileAsync() | fs.appendFile() |
fs.writeFileAsync() | fs.writeFile() |
fs.deleteAsync() | fs.rmdir() |
fs.renameAsync() | fs.rename() |
fs.copyAsync() | fs.cp() |
fs.existAsync() | fs.exist() |
fs.truncateAsync() | fs.truncate() |
Feedback
If you discover a bug, or have a suggestion for a feature request, please
submit an issue.
LICENSE
This extension is licensed under the MIT License