Update JSON API
[src/app-framework-demo.git] / afm-client / bower_components / jszip / documentation / upgrade_guide.md
1 ---
2 title: Upgrade Guide
3 layout: default
4 section: main
5 ---
6
7 ### From 2.2.2 to 2.3.0
8
9 * On `ZipObject#options`, the attributes `date` and `dir` have been
10   deprecated and are now on `ZipObject`.
11 * On `ZipObject#options`, the attributes `base64` and `binary` have been
12   deprecated.
13 * `JSZip.base64`, `JSZip.prototype.crc32`, `JSZip.prototype.utf8decode`,
14   `JSZip.prototype.utf8encode` and `JSZip.utils` have been deprecated.
15
16 ```js
17 // deprecated
18 zip.file("test.txt").options.date
19 zip.file("test.txt").options.dir
20 // new API
21 zip.file("test.txt").date
22 zip.file("test.txt").dir
23 ```
24
25
26 ### From 2.0.0 to 2.1.0
27
28 * The packaging changed : instead of loading jszip.js, jszip-load.js,
29   jszip-inflate.js, jszip-deflate.js, just include dist/jszip.js or
30   dist/jszip.min.js.
31   For AMD loader users : JSZip now registers itself. You just have to put the
32   file at the right place or configure your loader.
33
34
35 ### From 1.x to 2.x
36
37 * `JSZipBase64` has been renamed to `JSZip.base64`.
38 * The `data` attribute doesn't exist anymore :
39   use the getters `asText()`, `asBinary()`, etc
40 * The compression/decompression methods now give their input type with the
41   `compressInputType` and `uncompressInputType` attributes.
42
43 Example for the data attribute :
44
45 ```js
46 // before
47 zip.file("test.txt").data;
48 zip.files["test.txt"].data;
49 zip.file("image.png").data;
50 zip.files["image.png"].data;
51
52 // after
53 zip.file("test.txt").asText();
54 zip.files["test.txt"].asText();
55 zip.file("image.png").asBinary();
56 zip.files["image.png"].asBinary();
57 ```