https://github.com/cheminfo/file-collection
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords from Contributors
Repository
Basic Info
- Host: GitHub
- Owner: cheminfo
- License: mit
- Language: TypeScript
- Default Branch: main
- Size: 272 KB
Statistics
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 6
- Releases: 13
Metadata Files
README.md
file-collection
Library to manage large amount of files coming from different sources
Introduction
This library allows to manipulate a large amount of files coming from local or remote sources.
This library allows to have the same code in the browser and in nodejs.
This package allows to create a file-collection than can further be saved as a ium file (zip file containing all the data
and an index.json file).
The structure of the zip file is at follow:
- index.json
- data/
- all the files
Installation
npm i file-collection
Basic usage
Append a browser filelist
```js import { FileCollection } from 'file-collection';
const fileList; // a fileList resulting from a drag / drop in the browser const fileCollection = new FileCollection(); await fileCollection.appendFileList(fileList);
// get a zip file that can be reload later const iumFile = fileCollection.toIum();
// list the content of the fileCollection for (const file of fileCollection) { console.log(file.name); console.log(await file.text()); } ```
Reload a 'ium' file
```js import { fromIum } from 'file-collection';
const fileCollection = await fromIum(iumFile);
for (const file of fileCollection) { console.log(file.name); console.log(await file.text()); } ```
Using in a react component
A webSource is a URL to data like for example https://image-js.github.io/image-dataset-demo/index.json:
tsx
<MyComponent webSource onchange={(fileCollection) => {}}></MyComponent>
Inside the component we should:
js
const fileCollection = new FileCollection();
if (webSource) fileCollection.appendWebSource(webSource);
If we drag / drop some files we should:
js
fileCollection.appendFileList(fileList);
If we drag / drop a 'ium' file we should replace the full fileCollection
js
const fileCollection = FileCollection.fromIum(iumArrayBuffer);
const state = fileCollection.get('state');
If we want to save as a ium file:
js
fileCollection.set('state', myCurrentState);
const toSave = fileCollection.toIum();
When fileCollection changes we can always retrieve the various files using:
js
const files = [...fileCollection]; // fileCollection is iterable on its files property
Referencing files in the fileCollection
License
Owner
- Name: Cheminfo
- Login: cheminfo
- Kind: organization
- Website: https://www.cheminfo.org/
- Repositories: 242
- Profile: https://github.com/cheminfo
GitHub Events
Total
- Create event: 16
- Release event: 6
- Issues event: 9
- Delete event: 13
- Issue comment event: 34
- Push event: 52
- Pull request review event: 14
- Pull request review comment event: 8
- Pull request event: 21
Last Year
- Create event: 16
- Release event: 6
- Issues event: 9
- Delete event: 13
- Issue comment event: 34
- Push event: 52
- Pull request review event: 14
- Pull request review comment event: 8
- Pull request event: 21
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Luc Patiny | l****c@p****m | 36 |
| cheminfo-bot | 1****t | 12 |
| tpoisseau | 2****u | 11 |
| Michaël Zasso | t****s@p****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 12
- Total pull requests: 35
- Average time to close issues: 3 days
- Average time to close pull requests: 6 days
- Total issue authors: 2
- Total pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 1.91
- Merged pull requests: 30
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 7
- Pull requests: 31
- Average time to close issues: 3 days
- Average time to close pull requests: 1 day
- Issue authors: 2
- Pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 1.94
- Merged pull requests: 26
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- lpatiny (7)
- tpoisseau (5)
Pull Request Authors
- cheminfo-bot (17)
- tpoisseau (14)
- targos (1)
- lpatiny (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 2,293 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 13
- Total maintainers: 1
npmjs.org: file-collection
Library to manage large amount of files coming from different sources
- Homepage: https://github.com/cheminfo/file-collection#readme
- License: MIT
-
Latest release: 5.1.1
published 11 months ago