7 __Description__ : Get a file with the specified name. You can specify folders
8 in the name : the folder separator is a forward slash ("/").
12 name | type | description
13 -----|--------|-------------
14 name | string | the name of the file.
16 __Returns__ : An instance of [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html) representing
17 the file if any, `null` otherwise.
21 <!-- __Complexity__ : This is a simple lookup in **O(1)**. -->
26 var zip = new JSZip();
27 zip.file("file.txt", "content");
29 zip.file("file.txt").name // "file.txt"
30 zip.file("file.txt").asText() // "content"
31 zip.file("file.txt").options.dir // false
34 var zip = new JSZip(zipFromAjaxWithUTF8);
35 zip.file("amount.txt").asText() // "€15"
36 zip.file("amount.txt").asArrayBuffer() // an ArrayBuffer containing €15 encoded as utf8
37 zip.file("amount.txt").asUint8Array() // an Uint8Array containing €15 encoded as utf8
40 zip.folder("sub").file("file.txt", "content");
41 zip.file("sub/file.txt"); // the file
43 zip.folder("sub").file("file.txt") // the file