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

complete-file-system-cache

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

complete-file-system-cache

This library can be used to sync a folder from your device to GitHub. This is a fun project and I do not recommend to push large files.

  • 1.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Complete File System Cache v1.3.0 Documentation

NPM Version Package License NPM Downloads

Table of contents

Installation

npm i complete-file-system-cache

Description

Caches every file that exists in the file system and stores the whole file system files, where you want it to store and based on that it can do fast search in the cached content.

Usage example

import { CompleteFileSystemCache } from 'complete-file-system-cache'
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

const completeFileSystemCache = new CompleteFileSystemCache(__dirname)
completeFileSystemCache.cacheFileSystem()
const results = completeFileSystemCache.search(
  ['/Users/datomarjanidze'],
  ['.git', 'node_modules', '.cache', '.angular']
)

API

Types
export type FilePaths = string[]
CompleteFileSystemCache properties
cachedFileSystem
  • FileSystemCache

Returns the FileSystemCache if it exists.

CompleteFileSystemCache methods
constructor(projectRootDir)
  • projectRootDir: string This directory path will be used to store the file system cache.
cacheFileSystem()
  • Returns: void

Creates a file system cache if it already does not exist.

reloadFileSystemCache()
  • Returns: void

Recreates the file system cache.

search(includedPathSegments, excludedPathSegments, ignoreCase)
  • includedPathSegments: string[] | RegExp Path segments which should be included from the search results.
  • excludedPathSegments: string[] Default: [] Path segments which should be excluded from the search results.
  • ignoreCase Default: true Executes case insensitive search, if the provided argument is true.
  • Returns: FilePaths
cleanCache()
  • Returns: void

Cleans the cache.

Keywords

FAQs

Package last updated on 22 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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