summera / chromestore.js Goto Github PK
View Code? Open in Web Editor NEWSimple filesystem API wrapper for Chrome
Simple filesystem API wrapper for Chrome
Once data (in my use case: JSON text) is stored by chromestore.js on the local (client) machine, what is the mechanism of subsequently reading it for further use by local javascript routines? TIA Alex
Hi @summera
Thankx for the API ๐
I'm might not know how to use it properly, but if I'm trying to get a file, how can I set a callback if the file does not exist, when the flag create is set to false?
cs.getFile('data/foo.txt', {create: false, exclusive: true}, function (fileEntry) {
console.log('File created', fileEntry);
});
Cheers,
I found this library today and it looks like it will be a huge help for my chrome app.
However, I am dealing with downloaded several files that are a mix of HTML, JPG, PNG and JS.
The 3rd parameter of getAndWrite is the filetype. Is this a required parameter?
Do you have any suggestions on how to handle multiple file downloads?
Hi there
I have cloned your repo here and I finally want to use it to write some data into a json file.
unfortunately I cannot initiate chromestore from the beginning.
When I run your chromestore-test it seems to work fine, although I cannot find any files on my harddrive... (are there some created anyway?)
Well I get this error:
Uncaught ReferenceError: Chromestore is not defined
First I thought I did not load your chromestore.js or i loaded it accidentally before my own js file.
But thats not the case.
I also think I'm waiting long enough to load everything else...
I use this code in my js file:
$(document).ready(function() {
//initiate chromestore
var cs = new Chromestore([{
path: 'export/exportJSON',
callback: function() {
console.log('finished creating export folder tree')
}
}]);
//request bytes from filesystem
cs.init(1024 * 1024, function(cstore) {
console.log('Chromestore initialized');
});
//create file
cs.getFile('export/exportJSON/fileCreate.txt', {
create: true,
exclusive: true
}, function(fileEntry) {
console.log('File created');
});
});
and my html looks like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="../../03_libs/jquery/jquery-2.1.1.js"></script>
<script type="text/javascript" src="chromestorejs/chromestore.js"></script>
<script type="text/javascript" src="csvjson.js"></script>
</head>
<body>
</body>
</html>
Do you have a clue, why chromestore does seem to be there already?
Thanks, help would be very appreciated...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.