Skip to content

Commit 57595d6

Browse files
committed
docs: rename to flow.js and added origin section
1 parent 3dee1e0 commit 57595d6

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

README.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,46 @@
1-
# Lets rename this library! [Click to vote](https://docs.google.com/forms/d/1k_xUuXWbWbFZlCJDb43vAltcrJzighrdpk8-z8KU2ys/viewform)
1+
## Flow.js [![Build Status](https://travis-ci.org/resumable2/resumable.js.png)](https://travis-ci.org/resumable2/resumable.js) [![Coverage Status](https://coveralls.io/repos/resumable2/resumable.js/badge.png?branch=master)](https://coveralls.io/r/resumable2/resumable.js?branch=master)
22

33

4-
## Resumable.js v2 [![Build Status](https://travis-ci.org/resumable2/resumable.js.png)](https://travis-ci.org/resumable2/resumable.js) [![Coverage Status](https://coveralls.io/repos/resumable2/resumable.js/badge.png?branch=master)](https://coveralls.io/r/resumable2/resumable.js?branch=master)
5-
6-
7-
Resumable.js is a JavaScript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API.
4+
Flow.js is a JavaScript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API.
85

96
The library is designed to introduce fault-tolerance into the upload of large files through HTTP. This is done by splitting each file into small chunks. Then, whenever the upload of a chunk fails, uploading is retried until the procedure completes. This allows uploads to automatically resume uploading after a network connection is lost either locally or to the server. Additionally, it allows for users to pause, resume and even recover uploads without losing state because only the currently uploading chunks will be aborted, not the entire upload.
107

11-
Resumable.js does not have any external dependencies other than the `HTML5 File API`. This is relied on for the ability to chunk files into smaller pieces. Currently, this means that support is limited to Firefox 4+, Chrome 11+, Safari 6+ and Internet Explorer 10+.
8+
Flow.js does not have any external dependencies other than the `HTML5 File API`. This is relied on for the ability to chunk files into smaller pieces. Currently, this means that support is limited to Firefox 4+, Chrome 11+, Safari 6+ and Internet Explorer 10+.
129

1310
Samples and examples are available in the `samples/` folder. Please push your own as Markdown to help document the project.
1411

1512
## Can i see a demo?
16-
[Resumable.js + angular.js file upload demo](http://resumable2.github.io/ng-resumable/) - ng-resumable extension page https://github.com/resumable2/ng-resumable
13+
[Flow.js + angular.js file upload demo](http://flowjs.github.io/ng-flow/) - ng-flow extension page https://github.com/flowjs/ng-flow
1714

18-
JQuery and node.js backend demo https://github.com/resumable2/resumable.js/tree/master/samples/Node.js
15+
JQuery and node.js backend demo https://github.com/flowjs/flow.js/tree/master/samples/Node.js
1916

2017
## How can I install it?
2118
use bower:
2219

23-
bower install resumable.js#~2
24-
use cdn, look for available packages at http://www.jsdelivr.com/#!resumable.js
20+
bower install flow.js#~2
21+
use cdn, look for available packages at http://www.jsdelivr.com/#!flow.js
2522

2623
or use git clone
2724

28-
git clone https://github.com/resumable2/resumable.js
25+
git clone https://github.com/flowjs/flow.js
2926

3027
## How can I use it?
3128

32-
A new `Resumable` object is created with information of what and where to post:
29+
A new `Flow` object is created with information of what and where to post:
3330

34-
var r = new Resumable({
31+
var flow = new Flow({
3532
target:'/api/photo/redeem-upload-token',
3633
query:{upload_token:'my_token'}
3734
});
38-
// Resumable.js isn't supported, fall back on a different method
39-
if(!r.support) location.href = '/some-old-crappy-uploader';
35+
// Flow.js isn't supported, fall back on a different method
36+
if(!flow.support) location.href = '/some-old-crappy-uploader';
4037

4138
To allow files to be either selected and drag-dropped, you'll assign drop target and a DOM item to be clicked for browsing:
4239

43-
r.assignBrowse(document.getElementById('browseButton'));
44-
r.assignDrop(document.getElementById('dropTarget'));
40+
flow.assignBrowse(document.getElementById('browseButton'));
41+
flow.assignDrop(document.getElementById('dropTarget'));
4542

46-
After this, interaction with Resumable.js is done by listening to events:
43+
After this, interaction with Flow.js is done by listening to events:
4744

4845
r.on('fileAdded', function(file, event){
4946
...
@@ -57,19 +54,19 @@ After this, interaction with Resumable.js is done by listening to events:
5754

5855
## How do I set it up with my server?
5956

60-
Most of the magic for Resumable.js happens in the user's browser, but files still need to be reassembled from chunks on the server side. This should be a fairly simple task and can be achieved in any web framework or language, which is able to receive file uploads.
57+
Most of the magic for Flow.js happens in the user's browser, but files still need to be reassembled from chunks on the server side. This should be a fairly simple task and can be achieved in any web framework or language, which is able to receive file uploads.
6158

6259
To handle the state of upload chunks, a number of extra parameters are sent along with all requests:
6360

64-
* `resumableChunkNumber`: The index of the chunk in the current upload. First chunk is `1` (no base-0 counting here).
65-
* `resumableTotalChunks`: The total number of chunks.
66-
* `resumableChunkSize`: The general chunk size. Using this value and `resumableTotalSize` you can calculate the total number of chunks. Please note that the size of the data received in the HTTP might be lower than `resumableChunkSize` of this for the last chunk for a file.
67-
* `resumableTotalSize`: The total file size.
68-
* `resumableIdentifier`: A unique identifier for the file contained in the request.
69-
* `resumableFilename`: The original file name (since a bug in Firefox results in the file name not being transmitted in chunk multipart posts).
70-
* `resumableRelativePath`: The file's relative path when selecting a directory (defaults to file name in all browsers except Chrome).
61+
* `flowChunkNumber`: The index of the chunk in the current upload. First chunk is `1` (no base-0 counting here).
62+
* `flowTotalChunks`: The total number of chunks.
63+
* `flowChunkSize`: The general chunk size. Using this value and `flowTotalSize` you can calculate the total number of chunks. Please note that the size of the data received in the HTTP might be lower than `flowChunkSize` of this for the last chunk for a file.
64+
* `flowTotalSize`: The total file size.
65+
* `flowIdentifier`: A unique identifier for the file contained in the request.
66+
* `flowFilename`: The original file name (since a bug in Firefox results in the file name not being transmitted in chunk multipart posts).
67+
* `flowRelativePath`: The file's relative path when selecting a directory (defaults to file name in all browsers except Chrome).
7168

72-
You should allow for the same chunk to be uploaded more than once; this isn't standard behaviour, but on an unstable network environment it could happen, and this case is exactly what Resumable.js is designed for.
69+
You should allow for the same chunk to be uploaded more than once; this isn't standard behaviour, but on an unstable network environment it could happen, and this case is exactly what Flow.js is designed for.
7370

7471
For every request, you can confirm reception in HTTP status codes (can be change through the `permanentErrors` option):
7572

@@ -79,7 +76,7 @@ For every request, you can confirm reception in HTTP status codes (can be change
7976

8077
## Handling GET (or `test()` requests)
8178

82-
Enabling the `testChunks` option will allow uploads to be resumed after browser restarts and even across browsers (in theory you could even run the same file upload across multiple tabs or different browsers). The `POST` data requests listed are required to use Resumable.js to receive data, but you can extend support by implementing a corresponding `GET` request with the same parameters:
79+
Enabling the `testChunks` option will allow uploads to be resumed after browser restarts and even across browsers (in theory you could even run the same file upload across multiple tabs or different browsers). The `POST` data requests listed are required to use Flow.js to receive data, but you can extend support by implementing a corresponding `GET` request with the same parameters:
8380

8481
* If this request returns a `200` HTTP code, the chunks is assumed to have been completed.
8582
* If the request returns anything else, the chunk will be uploaded in the standard fashion.
@@ -88,12 +85,12 @@ After this is done and `testChunks` enabled, an upload can quickly catch up even
8885

8986
## Full documentation
9087

91-
### Resumable
88+
### Flow
9289
#### Configuration
9390

9491
The object is loaded with a configuration options:
9592

96-
var r = new Resumable({opt1:'val', ...});
93+
var r = new Flow({opt1:'val', ...});
9794

9895
Available configuration options are:
9996

@@ -103,7 +100,7 @@ Available configuration options are:
103100
* `forceChunkSize` Force all chunks to be less or equal than chunkSize. Otherwise, the last chunk will be greater than or equal to `chunkSize`. (Default: `false`)
104101
* `simultaneousUploads` Number of simultaneous uploads (Default: `3`)
105102
* `fileParameterName` The name of the multipart POST parameter to use for the file chunk (Default: `file`)
106-
* `query` Extra parameters to include in the multipart POST with data. This can be an object or a function. If a function, it will be passed a ResumableFile and a ResumableChunk object (Default: `{}`)
103+
* `query` Extra parameters to include in the multipart POST with data. This can be an object or a function. If a function, it will be passed a FlowFile and a FlowChunk object (Default: `{}`)
107104
* `headers` Extra headers to include in the multipart POST with data (Default: `{}`)
108105
* `withCredentials` Standard CORS requests do not send or set any cookies by default. In order to
109106
include cookies as part of the request, you need to set the `withCredentials` property to true.
@@ -125,25 +122,25 @@ parameter must be adjusted together with `progressCallbacksInterval` parameter.
125122

126123
#### Properties
127124

128-
* `.support` A boolean value indicator whether or not Resumable.js is supported by the current browser.
129-
* `.opts` A hash object of the configuration of the Resumable.js instance.
130-
* `.files` An array of `ResumableFile` file objects added by the user (see full docs for this object type below).
125+
* `.support` A boolean value indicator whether or not Flow.js is supported by the current browser.
126+
* `.opts` A hash object of the configuration of the Flow.js instance.
127+
* `.files` An array of `FlowFile` file objects added by the user (see full docs for this object type below).
131128

132129
#### Methods
133130

134131
* `.assignBrowse(domNodes, isDirectory, singleFile)` Assign a browse action to one or more DOM nodes. Pass in `true` to allow directories to be selected (Chrome only). To prevent multiple file uploads
135132
set singleFile to true.
136133
* `.assignDrop(domNodes)` Assign one or more DOM nodes as a drop target.
137-
* `.on(event, callback)` Listen for event from Resumable.js (see below)
134+
* `.on(event, callback)` Listen for event from Flow.js (see below)
138135
* `.upload()` Start or resume uploading.
139136
* `.pause()` Pause uploading.
140137
* `.resume()` Resume uploading.
141-
* `.cancel()` Cancel upload of all `ResumableFile` objects and remove them from the list.
138+
* `.cancel()` Cancel upload of all `FlowFile` objects and remove them from the list.
142139
* `.progress()` Returns a float between 0 and 1 indicating the current upload progress of all files.
143140
* `.isUploading()` Returns a boolean indicating whether or not the instance is currently uploading anything.
144141
* `.addFile(file)` Add a HTML5 File object to the list of files.
145-
* `.removeFile(file)` Cancel upload of a specific `ResumableFile` object on the list from the list.
146-
* `.getFromUniqueIdentifier(uniqueIdentifier)` Look up a `ResumableFile` object by its unique identifier.
142+
* `.removeFile(file)` Cancel upload of a specific `FlowFile` object on the list from the list.
143+
* `.getFromUniqueIdentifier(uniqueIdentifier)` Look up a `FlowFile` object by its unique identifier.
147144
* `.getSize()` Returns the total size of the upload in bytes.
148145

149146
#### Events
@@ -152,43 +149,43 @@ set singleFile to true.
152149
* `.fileProgress(file)` Uploading progressed for a specific file.
153150
* `.fileAdded(file, event)` This event is used for file validation. To reject this file return false.
154151
This event is also called before file is added to upload queue,
155-
this means that calling `Resumable.upload()` function will not start current file upload.
152+
this means that calling `flow.upload()` function will not start current file upload.
156153
Optionally, you can use the browser `event` object from when the file was
157154
added.
158155
* `.filesAdded(array, event)` Same as fileAdded, but used for multiple file validation.
159156
* `.filesSubmitted(array, event)` Can be used to start upload of currently added files.
160157
* `.fileRetry(file)` Something went wrong during upload of a specific file, uploading is being retried.
161158
* `.fileError(file, message)` An error occured during upload of a specific file.
162-
* `.uploadStart()` Upload has been started on the Resumable object.
159+
* `.uploadStart()` Upload has been started on the Flow object.
163160
* `.complete()` Uploading completed.
164161
* `.progress()` Uploading progress.
165162
* `.error(message, file)` An error, including fileError, occured.
166163
* `.catchAll(event, ...)` Listen to all the events listed above with the same callback function.
167164

168-
### ResumableFile
169-
ResumableFile constructor can be accessed in `Resumable.ResumableFile`.
165+
### FlowFile
166+
FlowFile constructor can be accessed in `Flow.FlowFile`.
170167
#### Properties
171168

172-
* `.resumableObj` A back-reference to the parent `Resumable` object.
169+
* `.flowObj` A back-reference to the parent `Flow` object.
173170
* `.file` The correlating HTML5 `File` object.
174171
* `.fileName` The name of the file.
175172
* `.relativePath` The relative path to the file (defaults to file name if relative path doesn't exist)
176173
* `.size` Size in bytes of the file.
177174
* `.uniqueIdentifier` A unique identifier assigned to this file object. This value is included in uploads to the server for reference, but can also be used in CSS classes etc when building your upload UI.
178175
* `.averageSpeed` Average upload speed, bytes per second.
179176
* `.currentSpeed` Current upload speed, bytes per second.
180-
* `.chunks` An array of `ResumableChunk` items. You shouldn't need to dig into these.
177+
* `.chunks` An array of `FlowChunk` items. You shouldn't need to dig into these.
181178
* `.paused` Indicated if file is paused.
182179
* `.error` Indicated if file has encountered an error.
183180

184181
#### Methods
185182

186-
* `.progress(relative)` Returns a float between 0 and 1 indicating the current upload progress of the file. If `relative` is `true`, the value is returned relative to all files in the Resumable.js instance.
183+
* `.progress(relative)` Returns a float between 0 and 1 indicating the current upload progress of the file. If `relative` is `true`, the value is returned relative to all files in the Flow.js instance.
187184
* `.pause()` Pause uploading the file.
188185
* `.resume()` Resume uploading the file.
189186
* `.cancel()` Abort uploading the file and delete it from the list of files to upload.
190187
* `.retry()` Retry uploading the file.
191-
* `.bootstrap()` Rebuild the state of a `ResumableFile` object, including reassigning chunks and XMLHttpRequest instances.
188+
* `.bootstrap()` Rebuild the state of a `FlowFile` object, including reassigning chunks and XMLHttpRequest instances.
192189
* `.isUploading()` Returns a boolean indicating whether file chunks is uploading.
193190
* `.isComplete()` Returns a boolean indicating whether the file has completed uploading and received a server response.
194191
* `.sizeUploaded()` Returns size uploaded in bytes.
@@ -209,11 +206,11 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
209206
## Installation Dependencies
210207
1. To clone your Github repository, run:
211208

212-
git clone [email protected]:<github username>/resumable.js.git
209+
git clone [email protected]:<github username>/flow.js.git
213210

214-
2. To go to the Resumable.js directory, run:
211+
2. To go to the Flow.js directory, run:
215212

216-
cd resumable.js
213+
cd flow.js
217214

218215
3. To add node.js dependencies
219216

@@ -242,3 +239,6 @@ Automated tests is running after every commit at travis-ci.
242239
2. `grunt test --sauce-local=true --sauce-username=**** --sauce-access-key=***`
243240

244241
other browsers can be used with `--browsers` flag, available browsers: sl_opera,sl_iphone,sl_safari,sl_ie10,sl_chorme,sl_firefox
242+
243+
## Origin
244+
Flow.js was inspired by and evolved from https://github.com/23/resumable.js. Library has been supplemented with tests and features, such as drag and drop for folders, upload speed, time remaining estimation, separate files pause, resume and more.

0 commit comments

Comments
 (0)