Implemented URL query parsing for initial token /opa/?token=abcde
[src/app-framework-demo.git] / afb-client / bower_components / jszip / documentation / api_jszip / folder_data.md
1 ---
2 title: "folder(name)"
3 layout: default
4 section: api
5 ---
6
7 __Description__ : Create a directory if it doesn't exist, return a new JSZip
8 object with the new folder as root.
9
10 See also [the `dir` option of file()]({{site.baseurl}}/documentation/api_jszip/file_data.html).
11
12 __Arguments__
13
14 name | type   | description
15 -----|--------|------------
16 name | string | the name of the directory.
17
18 __Returns__ : A new JSZip (for chaining), with the new folder as root.
19
20 __Throws__ : Nothing.
21
22 <!-- __Complexity__ : **O(1)** -->
23
24 __Example__
25
26 ```js
27 zip.folder("images");
28 zip.folder("css").file("style.css", "body {background: #FF0000}");
29 // or specify an absolute path (using forward slashes)
30 zip.file("css/font.css", "body {font-family: sans-serif}")
31
32 // result : images/, css/, css/style.css, css/font.css
33 ```
34