Update JSON API
[src/app-framework-demo.git] / afm-client / bower_components / jszip / documentation / api_jszip / remove.md
1 ---
2 title: "remove(name)"
3 layout: default
4 section: api
5 ---
6
7 __Description__ : Delete a file or folder (recursively).
8
9 __Arguments__
10
11 name | type   | description
12 -----|--------|------------
13 name | string | the name of the file/folder to delete.
14
15 __Returns__ : The current JSZip object.
16
17 __Throws__ : Nothing.
18
19 <!--
20 __Complexity__ : **O(k)** where k is the number of entry to delete (may be > 1
21 when removing a folder).
22 -->
23
24 __Example__
25
26 ```js
27 var zip = new JSZip();
28 zip.file("Hello.txt", "Hello World\n");
29 zip.file("temp.txt", "nothing").remove("temp.txt");
30 // result : Hello.txt
31
32 zip.folder("css").file("style.css", "body {background: #FF0000}");
33 zip.remove("css");
34 //result : empty zip
35 ```
36
37