npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vscode-utility/fs-browserify

v1.0.6

Published

The `fs` module compatible for VS Code Web Extensions

Downloads

8

Readme

CI GitHub license

npm version Gitpod Ready-to-Code install size npm bundle size npm downloads Known Vulnerabilities

@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.

This library utilizes a portion of the File System provided by the VS Code API.

If you find this package useful for your projects, please consider supporting me by Patreon, KO-FI or Paypal. It's a great way to help me maintain and improve this tool in the future. Your support is truly appreciated!

KO-FI Paypal Patreon

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';

// Retrieve file metadata
await fs.statAsync(path);

// Retrieve all directory entries
await fs.readDirectoryAsync(path);

// Create a new directory
await fs.createDirectoryAsync(path);

// Read the full content of a file
await fs.readFileAsync(path, options);

// Append the provided data to a file
await fs.appendFileAsync(path, content);

// Write data to a file and replace its full contents
await fs.writeFileAsync(path, content);

// Delete a file
await fs.deleteAsync(path, options);

// Rename a file or folder
await fs.renameAsync(source, target, options);

// Copy files or folders
await fs.copyAsync(source, target, options);

// Check if a given path exists or not in the file system
await fs.existAsync(source);

// Truncates the file to change the size of the file i.e either increase or decrease the file size
await fs.existAsync(path, length);

// Check the permissions of a given file
fs.access(path);

Compare functions

| @vscode-utility/fs-browserify | fs (node) | fs (vscode api) | | ----------------------------- | ----------------- | ---------------------- | | fs.statAsync() | fs.stat() | fs.stat() | | fs.readDirectoryAsync() | fs.readDir() | fs.readDirectory() | | fs.createDirectoryAsync() | fs.mkdir() | fs.createDirectory() | | fs.readFileAsync() | fs.readFile() | fs.readFile() | | fs.appendFileAsync() | fs.appendFile() | undefined | | fs.writeFileAsync() | fs.writeFile() | fs.writeFile() | | fs.deleteAsync() | fs.rmdir() | fs.delete() | | fs.renameAsync() | fs.rename() | fs.rename() | | fs.copyAsync() | fs.cp() | fs.copy() | | fs.existAsync() | fs.exist() | undefined | | fs.truncateAsync() | fs.truncate() | undefined | | fs.watch() | fs.watch() | undefined | | fs.access() | fs.access() | undefined |

  • @vscode-utility/fs-browserify

    • Provides seamless compatibility for both the desktop and web versions of VS Code
    • Supports additional functions that are missing from the File System API
  • fs (node)

    • Only works with the desktop version of VS Code
  • fs (vscode api)

    • Missing some necessary functions for the File System

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