0.42.1 • Published 3 years ago

@sugarcube/plugin-fs v0.42.1

Weekly downloads
5
License
GPL-3.0
Repository
github
Last release
3 years ago

@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

0.42.1

3 years ago

0.42.0

4 years ago

0.41.0

4 years ago

0.40.0

4 years ago

0.39.0

4 years ago

0.38.0

4 years ago

0.37.0

4 years ago

0.36.0

4 years ago

0.35.0

4 years ago

0.34.0

4 years ago

0.33.0

4 years ago

0.32.1

5 years ago

0.32.0

5 years ago

0.31.0

5 years ago

0.30.2

5 years ago

0.30.1

5 years ago

0.30.0

5 years ago

0.29.0

5 years ago

0.28.0

5 years ago

0.27.2

5 years ago

0.27.0

5 years ago

0.26.0

5 years ago

0.25.1

5 years ago

0.25.0

5 years ago

0.24.0

5 years ago

0.23.0

5 years ago

0.22.0

5 years ago

0.21.0

5 years ago

0.20.1

5 years ago

0.20.0

5 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.1

5 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.1

7 years ago