0.0.10 • Published 4 years ago

filespicker v0.0.10

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

filespicker

Tool for pick files from computer

Opens files picker window and parse content.

Types of content:

  • file: FilesPicker object representing loaded file;
  • text: Name of original file;
  • binary: Binary string;
  • url: Data URL;
  • buffer: Buffer representing loading file.
import picker from 'filespicker';

// Multiple
picker(true).then(file => ...);

// Single
picker(false).then(...);

// Single file as FileItem object
picker.file()
  .then(file => file.toFile())
  .then(file => ...);

// Multiple files as FileItem object
picker.files()
  .then(file => file.toFile())
  .then(file => ...);

// Single file as text
picker.file()
  .then(file => file.toText())
  .then(data => {});

// Single file as binary string
picker.file()
  .then(file => file.toBinaryString())
  .then(data => {});

// Single file as Data URL
picker.file()
  .then(file => file.toDataUrl())
  .then(data => {});
0.0.10

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago