GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - peermusic/file-system: A slim wrapper around the Chrome filesystem API.

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

file-system

A slim wrapper around the Chrome filesystem API.

Install

npm install https://github.com/peermusic/file-system
var fs = require('file-system')(size, types)

For reference see the Browserify Handbook.

Demo

npm install -g wzrd
cd example
wzrd index.js:bundle.js

Note: If no local webserver (eg. wzrd) is used Chrome has to be started with the --allow-file-access-from-files flag.

Usage

// Require the module with the (optional) allowed file types
var types = ['audio/mp3', 'audio/wav', 'audio/ogg']
var fs = require('file-system')(types)

// Callback is a Node.js-typical callback that takes an error as the first
// parameter and a possible result as the second
var callback = function (err, result) {
  if (err) throw err
  console.log(result)
}

// Add a single file to the filesystem
// If filename is not set, file.name will be used
fs.add({filename: '...', file: File}, callback)

// Add a single file to the filesystem using a array buffer
fs.addArrayBuffer({filename: '...', arrayBuffer: ArrayBuffer)

// Add multiple files to the filesystem
fs.addMultiple([{filename: '...', file: File}, /* ... */], callback)

// Get the url to a file from the filesystem based on name
fs.get(filename, callback)

// Get a file as a data url from the filesystem based on name
fs.getDataUrl(filename, callback)

// Get a file as a array buffer from the filesystem based on name
fs.getArrayBuffer(filename, callback)

// Get all files in the filesystem
fs.list(callback)

// Delete a single file from the filesystem based on filename
fs.delete(filename, callback)

// Delete all files from the filesystem
fs.clear(callback)

About

A slim wrapper around the Chrome filesystem API.

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.