<script src="https://jc3213.github.io/metalink.js/metalink.js"></script>
// @require https://jc3213.github.io/metalink.js/metalink.js
let file1 = {url: {url: 'https://jc3213.github.io/metalink.js/metalink.js', location: 'en'}, version: '0.1.0'};
let file2 = {url: 'https://github.com/jc3213/metalink.js/archive/refs/heads/main.zip', name: 'metalink.js_by_@jc3213.zip'}
let metalink = new Metalink(file1, file2);
- Syntax {
url
,name
,size
,version
,language
,hash
,metaurl
} - url
- name
- size
- version
- language
- hash
- metaurl
- The download url(s) of the file
string
object
: {url, location}url
: requiredlocation
: optional
array
: [string1, string2, string3, ...]array
: [object1, object2, object3, ...]
- The name of the file
string
- The size of the file
integer
- The version of the file
string
- The language of the file
string
- The hash(es) of the file
object
: {type, hash}type
: requiredhash
: required
array
: [object1, object2, object3, ...]
- The metalink(s) of the file
object
: {type, url}type
: requiredurl
: required
array
: [object1, object2, object3, ...]
metalink.save(filename);
- filename
String
- The file name you'd like to save
- Default
metalink_yymmdd_hhmmss