🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@sugarcube/plugin-fs

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sugarcube/plugin-fs

Operate on the file system.

latest
Source
npmnpm
Version
0.42.1
Version published
Maintainers
1
Created
Source

@sugarcube/plugin-fs

Interact with the file system.

Installation

npm install --save @sugarcube/plugin-fs

Plugins

fs_import

The query type is glob_pattern. It expands the glob pattern and turns every file into an unit. If possible, it extracts the body and meta data from the file using Apache Tika.

Example:

sugarcube -Q glob_pattern:path/to/files/** -p fs_import

Configuration:

  • fs.extract_language: Set the language to use for OCR extraction. The language code must be a ISO 839-2 3 letter code and supported by Tesseract. Make sure to install the language pack for Tesseract as well. Example languages are: eng for English, deu for German and ara for Arabic. The default language is eng.

Metrics:

  • total: The total number of files imported.
  • fail: The number of files that failed to import.
  • success: The number files that succeeded to import.

fs_from_json

The query type is glob_pattern. It expands the glob pattern and import each file as a JSON file. The contents of the JSON files are imported as units of data.

Example:

sugarcube -Q glob_pattern:path/to/files/*.json -p fs_from_json

Configuration:

This plugin offers no configuration.

Metrics:

  • total: The total number of units imported.
  • fail: The number of files that failed to import.
  • success: The number of units that succeeded to import.

API

unfold

Unfold a glob pattern into a list of file objects.

unfold :: String -> Future [a]

Parameters

  • pattern string A glob file pattern.

Returns Promise<Array<Object>> A list of file objects. Contains location, sha256 and md5 sums.

License

GPL3 @ Christo

Keywords

data

FAQs

Package last updated on 13 Jul 2021

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