dragonfly_chrome_headless 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +12 -0
  4. data/Gemfile +4 -0
  5. data/README.md +53 -0
  6. data/Rakefile +10 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/dragonfly_chrome_headless.gemspec +27 -0
  10. data/lib/dragonfly_chrome_headless.rb +9 -0
  11. data/lib/dragonfly_chrome_headless/plugin.rb +17 -0
  12. data/lib/dragonfly_chrome_headless/processors/rasterize.rb +33 -0
  13. data/lib/dragonfly_chrome_headless/version.rb +3 -0
  14. data/node_modules/.bin/chrome-remote-interface +1 -0
  15. data/node_modules/.bin/mkdirp +1 -0
  16. data/node_modules/.bin/rimraf +1 -0
  17. data/node_modules/@types/core-js/LICENSE +21 -0
  18. data/node_modules/@types/core-js/README.md +16 -0
  19. data/node_modules/@types/core-js/index.d.ts +2452 -0
  20. data/node_modules/@types/core-js/package.json +85 -0
  21. data/node_modules/@types/mkdirp/README.md +18 -0
  22. data/node_modules/@types/mkdirp/index.d.ts +14 -0
  23. data/node_modules/@types/mkdirp/package.json +77 -0
  24. data/node_modules/@types/mkdirp/types-metadata.json +25 -0
  25. data/node_modules/@types/node/README.md +16 -0
  26. data/node_modules/@types/node/index.d.ts +4132 -0
  27. data/node_modules/@types/node/package.json +84 -0
  28. data/node_modules/balanced-match/.npmignore +5 -0
  29. data/node_modules/balanced-match/LICENSE.md +21 -0
  30. data/node_modules/balanced-match/README.md +91 -0
  31. data/node_modules/balanced-match/index.js +59 -0
  32. data/node_modules/balanced-match/package.json +112 -0
  33. data/node_modules/brace-expansion/README.md +123 -0
  34. data/node_modules/brace-expansion/index.js +201 -0
  35. data/node_modules/brace-expansion/package.json +114 -0
  36. data/node_modules/chrome-launcher/.clang-format +6 -0
  37. data/node_modules/chrome-launcher/.npmignore +11 -0
  38. data/node_modules/chrome-launcher/README.md +123 -0
  39. data/node_modules/chrome-launcher/ask.js +32 -0
  40. data/node_modules/chrome-launcher/ask.ts +35 -0
  41. data/node_modules/chrome-launcher/chrome-finder.js +157 -0
  42. data/node_modules/chrome-launcher/chrome-finder.ts +186 -0
  43. data/node_modules/chrome-launcher/chrome-launcher.js +245 -0
  44. data/node_modules/chrome-launcher/chrome-launcher.ts +312 -0
  45. data/node_modules/chrome-launcher/compiled-check.js +14 -0
  46. data/node_modules/chrome-launcher/flags.js +27 -0
  47. data/node_modules/chrome-launcher/flags.ts +26 -0
  48. data/node_modules/chrome-launcher/index.js +7 -0
  49. data/node_modules/chrome-launcher/index.ts +1 -0
  50. data/node_modules/chrome-launcher/manual-chrome-launcher.js +30 -0
  51. data/node_modules/chrome-launcher/package.json +116 -0
  52. data/node_modules/chrome-launcher/random-port.js +24 -0
  53. data/node_modules/chrome-launcher/random-port.ts +23 -0
  54. data/node_modules/chrome-launcher/tsconfig.json +19 -0
  55. data/node_modules/chrome-launcher/utils.js +52 -0
  56. data/node_modules/chrome-launcher/utils.ts +44 -0
  57. data/node_modules/chrome-launcher/yarn.lock +1486 -0
  58. data/node_modules/chrome-remote-interface/LICENSE +18 -0
  59. data/node_modules/chrome-remote-interface/README.md +849 -0
  60. data/node_modules/chrome-remote-interface/bin/client.js +337 -0
  61. data/node_modules/chrome-remote-interface/chrome-remote-interface.js +11 -0
  62. data/node_modules/chrome-remote-interface/index.js +39 -0
  63. data/node_modules/chrome-remote-interface/lib/api.js +84 -0
  64. data/node_modules/chrome-remote-interface/lib/chrome.js +307 -0
  65. data/node_modules/chrome-remote-interface/lib/defaults.js +4 -0
  66. data/node_modules/chrome-remote-interface/lib/devtools.js +245 -0
  67. data/node_modules/chrome-remote-interface/lib/external-request.js +28 -0
  68. data/node_modules/chrome-remote-interface/lib/protocol.json +13780 -0
  69. data/node_modules/chrome-remote-interface/lib/websocket-wrapper.js +32 -0
  70. data/node_modules/chrome-remote-interface/package.json +128 -0
  71. data/node_modules/chrome-remote-interface/webpack.config.js +55 -0
  72. data/node_modules/commander/Readme.md +195 -0
  73. data/node_modules/commander/index.js +851 -0
  74. data/node_modules/commander/package.json +92 -0
  75. data/node_modules/concat-map/.travis.yml +4 -0
  76. data/node_modules/concat-map/LICENSE +18 -0
  77. data/node_modules/concat-map/README.markdown +62 -0
  78. data/node_modules/concat-map/example/map.js +6 -0
  79. data/node_modules/concat-map/index.js +13 -0
  80. data/node_modules/concat-map/package.json +117 -0
  81. data/node_modules/concat-map/test/map.js +39 -0
  82. data/node_modules/debug/.coveralls.yml +1 -0
  83. data/node_modules/debug/.eslintrc +11 -0
  84. data/node_modules/debug/.npmignore +9 -0
  85. data/node_modules/debug/.travis.yml +14 -0
  86. data/node_modules/debug/CHANGELOG.md +357 -0
  87. data/node_modules/debug/LICENSE +19 -0
  88. data/node_modules/debug/Makefile +50 -0
  89. data/node_modules/debug/Readme.md +312 -0
  90. data/node_modules/debug/component.json +19 -0
  91. data/node_modules/debug/karma.conf.js +70 -0
  92. data/node_modules/debug/node.js +1 -0
  93. data/node_modules/debug/package.json +124 -0
  94. data/node_modules/debug/src/browser.js +185 -0
  95. data/node_modules/debug/src/debug.js +202 -0
  96. data/node_modules/debug/src/index.js +10 -0
  97. data/node_modules/debug/src/node.js +246 -0
  98. data/node_modules/fs.realpath/LICENSE +43 -0
  99. data/node_modules/fs.realpath/README.md +33 -0
  100. data/node_modules/fs.realpath/index.js +66 -0
  101. data/node_modules/fs.realpath/old.js +303 -0
  102. data/node_modules/fs.realpath/package.json +94 -0
  103. data/node_modules/glob/LICENSE +15 -0
  104. data/node_modules/glob/README.md +368 -0
  105. data/node_modules/glob/changelog.md +67 -0
  106. data/node_modules/glob/common.js +240 -0
  107. data/node_modules/glob/glob.js +790 -0
  108. data/node_modules/glob/package.json +112 -0
  109. data/node_modules/glob/sync.js +486 -0
  110. data/node_modules/html-pdf-chrome/.npmignore +9 -0
  111. data/node_modules/html-pdf-chrome/LICENSE +21 -0
  112. data/node_modules/html-pdf-chrome/README.md +165 -0
  113. data/node_modules/html-pdf-chrome/lib/src/ChromePrintOptions.d.ts +87 -0
  114. data/node_modules/html-pdf-chrome/lib/src/ChromePrintOptions.js +4 -0
  115. data/node_modules/html-pdf-chrome/lib/src/ChromePrintOptions.js.map +1 -0
  116. data/node_modules/html-pdf-chrome/lib/src/CompletionTrigger.d.ts +120 -0
  117. data/node_modules/html-pdf-chrome/lib/src/CompletionTrigger.js +206 -0
  118. data/node_modules/html-pdf-chrome/lib/src/CompletionTrigger.js.map +1 -0
  119. data/node_modules/html-pdf-chrome/lib/src/CreateResult.d.ts +70 -0
  120. data/node_modules/html-pdf-chrome/lib/src/CreateResult.js +98 -0
  121. data/node_modules/html-pdf-chrome/lib/src/CreateResult.js.map +1 -0
  122. data/node_modules/html-pdf-chrome/lib/src/index.d.ts +72 -0
  123. data/node_modules/html-pdf-chrome/lib/src/index.js +123 -0
  124. data/node_modules/html-pdf-chrome/lib/src/index.js.map +1 -0
  125. data/node_modules/html-pdf-chrome/package.json +133 -0
  126. data/node_modules/html-pdf-chrome/src/ChromePrintOptions.ts +99 -0
  127. data/node_modules/html-pdf-chrome/src/CompletionTrigger.ts +201 -0
  128. data/node_modules/html-pdf-chrome/src/CreateResult.ts +100 -0
  129. data/node_modules/html-pdf-chrome/src/index.ts +179 -0
  130. data/node_modules/inflight/LICENSE +15 -0
  131. data/node_modules/inflight/README.md +37 -0
  132. data/node_modules/inflight/inflight.js +54 -0
  133. data/node_modules/inflight/package.json +105 -0
  134. data/node_modules/inherits/LICENSE +16 -0
  135. data/node_modules/inherits/README.md +42 -0
  136. data/node_modules/inherits/inherits.js +7 -0
  137. data/node_modules/inherits/inherits_browser.js +23 -0
  138. data/node_modules/inherits/package.json +97 -0
  139. data/node_modules/lighthouse-logger/README.md +4 -0
  140. data/node_modules/lighthouse-logger/index.js +212 -0
  141. data/node_modules/lighthouse-logger/package.json +69 -0
  142. data/node_modules/lighthouse-logger/yarn.lock +13 -0
  143. data/node_modules/minimatch/LICENSE +15 -0
  144. data/node_modules/minimatch/README.md +209 -0
  145. data/node_modules/minimatch/minimatch.js +923 -0
  146. data/node_modules/minimatch/package.json +99 -0
  147. data/node_modules/minimist/.travis.yml +4 -0
  148. data/node_modules/minimist/LICENSE +18 -0
  149. data/node_modules/minimist/example/parse.js +2 -0
  150. data/node_modules/minimist/index.js +187 -0
  151. data/node_modules/minimist/package.json +101 -0
  152. data/node_modules/minimist/readme.markdown +73 -0
  153. data/node_modules/minimist/test/dash.js +24 -0
  154. data/node_modules/minimist/test/default_bool.js +20 -0
  155. data/node_modules/minimist/test/dotted.js +16 -0
  156. data/node_modules/minimist/test/long.js +31 -0
  157. data/node_modules/minimist/test/parse.js +318 -0
  158. data/node_modules/minimist/test/parse_modified.js +9 -0
  159. data/node_modules/minimist/test/short.js +67 -0
  160. data/node_modules/minimist/test/whitespace.js +8 -0
  161. data/node_modules/mkdirp/.travis.yml +8 -0
  162. data/node_modules/mkdirp/LICENSE +21 -0
  163. data/node_modules/mkdirp/bin/cmd.js +33 -0
  164. data/node_modules/mkdirp/bin/usage.txt +12 -0
  165. data/node_modules/mkdirp/examples/pow.js +6 -0
  166. data/node_modules/mkdirp/index.js +98 -0
  167. data/node_modules/mkdirp/package.json +93 -0
  168. data/node_modules/mkdirp/readme.markdown +100 -0
  169. data/node_modules/mkdirp/test/chmod.js +41 -0
  170. data/node_modules/mkdirp/test/clobber.js +38 -0
  171. data/node_modules/mkdirp/test/mkdirp.js +28 -0
  172. data/node_modules/mkdirp/test/opts_fs.js +29 -0
  173. data/node_modules/mkdirp/test/opts_fs_sync.js +27 -0
  174. data/node_modules/mkdirp/test/perm.js +32 -0
  175. data/node_modules/mkdirp/test/perm_sync.js +36 -0
  176. data/node_modules/mkdirp/test/race.js +37 -0
  177. data/node_modules/mkdirp/test/rel.js +32 -0
  178. data/node_modules/mkdirp/test/return.js +25 -0
  179. data/node_modules/mkdirp/test/return_sync.js +24 -0
  180. data/node_modules/mkdirp/test/root.js +19 -0
  181. data/node_modules/mkdirp/test/sync.js +32 -0
  182. data/node_modules/mkdirp/test/umask.js +28 -0
  183. data/node_modules/mkdirp/test/umask_sync.js +32 -0
  184. data/node_modules/ms/README.md +51 -0
  185. data/node_modules/ms/index.js +152 -0
  186. data/node_modules/ms/license.md +21 -0
  187. data/node_modules/ms/package.json +109 -0
  188. data/node_modules/once/LICENSE +15 -0
  189. data/node_modules/once/README.md +79 -0
  190. data/node_modules/once/once.js +42 -0
  191. data/node_modules/once/package.json +101 -0
  192. data/node_modules/path-is-absolute/index.js +20 -0
  193. data/node_modules/path-is-absolute/license +21 -0
  194. data/node_modules/path-is-absolute/package.json +111 -0
  195. data/node_modules/path-is-absolute/readme.md +59 -0
  196. data/node_modules/rimraf/LICENSE +15 -0
  197. data/node_modules/rimraf/README.md +101 -0
  198. data/node_modules/rimraf/bin.js +50 -0
  199. data/node_modules/rimraf/package.json +99 -0
  200. data/node_modules/rimraf/rimraf.js +363 -0
  201. data/node_modules/ultron/LICENSE +22 -0
  202. data/node_modules/ultron/index.js +138 -0
  203. data/node_modules/ultron/package.json +112 -0
  204. data/node_modules/wrappy/LICENSE +15 -0
  205. data/node_modules/wrappy/README.md +36 -0
  206. data/node_modules/wrappy/package.json +97 -0
  207. data/node_modules/wrappy/wrappy.js +33 -0
  208. data/node_modules/ws/LICENSE +21 -0
  209. data/node_modules/ws/README.md +259 -0
  210. data/node_modules/ws/SECURITY.md +33 -0
  211. data/node_modules/ws/index.js +15 -0
  212. data/node_modules/ws/lib/BufferUtil.fallback.js +56 -0
  213. data/node_modules/ws/lib/BufferUtil.js +15 -0
  214. data/node_modules/ws/lib/ErrorCodes.js +28 -0
  215. data/node_modules/ws/lib/EventTarget.js +158 -0
  216. data/node_modules/ws/lib/Extensions.js +69 -0
  217. data/node_modules/ws/lib/PerMessageDeflate.js +339 -0
  218. data/node_modules/ws/lib/Receiver.js +520 -0
  219. data/node_modules/ws/lib/Sender.js +438 -0
  220. data/node_modules/ws/lib/Validation.fallback.js +9 -0
  221. data/node_modules/ws/lib/Validation.js +17 -0
  222. data/node_modules/ws/lib/WebSocket.js +705 -0
  223. data/node_modules/ws/lib/WebSocketServer.js +336 -0
  224. data/node_modules/ws/package.json +122 -0
  225. data/package.json +26 -0
  226. data/samples/sample.html +13 -0
  227. data/script/rasterize.js +18 -0
  228. metadata +325 -0
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ function posix(path) {
4
+ return path.charAt(0) === '/';
5
+ }
6
+
7
+ function win32(path) {
8
+ // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
9
+ var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
10
+ var result = splitDeviceRe.exec(path);
11
+ var device = result[1] || '';
12
+ var isUnc = Boolean(device && device.charAt(1) !== ':');
13
+
14
+ // UNC paths are always absolute
15
+ return Boolean(result[2] || isUnc);
16
+ }
17
+
18
+ module.exports = process.platform === 'win32' ? win32 : posix;
19
+ module.exports.posix = posix;
20
+ module.exports.win32 = win32;
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,111 @@
1
+ {
2
+ "_args": [
3
+ [
4
+ {
5
+ "raw": "path-is-absolute@^1.0.0",
6
+ "scope": null,
7
+ "escapedName": "path-is-absolute",
8
+ "name": "path-is-absolute",
9
+ "rawSpec": "^1.0.0",
10
+ "spec": ">=1.0.0 <2.0.0",
11
+ "type": "range"
12
+ },
13
+ "/Users/tomascelizna/Devel/dragonfly_chrome_headless/node_modules/glob"
14
+ ]
15
+ ],
16
+ "_from": "path-is-absolute@>=1.0.0 <2.0.0",
17
+ "_id": "path-is-absolute@1.0.1",
18
+ "_inCache": true,
19
+ "_location": "/path-is-absolute",
20
+ "_nodeVersion": "6.6.0",
21
+ "_npmOperationalInternal": {
22
+ "host": "packages-12-west.internal.npmjs.com",
23
+ "tmp": "tmp/path-is-absolute-1.0.1.tgz_1475210523565_0.9876507974695414"
24
+ },
25
+ "_npmUser": {
26
+ "name": "sindresorhus",
27
+ "email": "sindresorhus@gmail.com"
28
+ },
29
+ "_npmVersion": "3.10.3",
30
+ "_phantomChildren": {},
31
+ "_requested": {
32
+ "raw": "path-is-absolute@^1.0.0",
33
+ "scope": null,
34
+ "escapedName": "path-is-absolute",
35
+ "name": "path-is-absolute",
36
+ "rawSpec": "^1.0.0",
37
+ "spec": ">=1.0.0 <2.0.0",
38
+ "type": "range"
39
+ },
40
+ "_requiredBy": [
41
+ "/glob"
42
+ ],
43
+ "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
44
+ "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
45
+ "_shrinkwrap": null,
46
+ "_spec": "path-is-absolute@^1.0.0",
47
+ "_where": "/Users/tomascelizna/Devel/dragonfly_chrome_headless/node_modules/glob",
48
+ "author": {
49
+ "name": "Sindre Sorhus",
50
+ "email": "sindresorhus@gmail.com",
51
+ "url": "sindresorhus.com"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/sindresorhus/path-is-absolute/issues"
55
+ },
56
+ "dependencies": {},
57
+ "description": "Node.js 0.12 path.isAbsolute() ponyfill",
58
+ "devDependencies": {
59
+ "xo": "^0.16.0"
60
+ },
61
+ "directories": {},
62
+ "dist": {
63
+ "shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
64
+ "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
65
+ },
66
+ "engines": {
67
+ "node": ">=0.10.0"
68
+ },
69
+ "files": [
70
+ "index.js"
71
+ ],
72
+ "gitHead": "edc91d348b21dac2ab65ea2fbec2868e2eff5eb6",
73
+ "homepage": "https://github.com/sindresorhus/path-is-absolute#readme",
74
+ "keywords": [
75
+ "path",
76
+ "paths",
77
+ "file",
78
+ "dir",
79
+ "absolute",
80
+ "isabsolute",
81
+ "is-absolute",
82
+ "built-in",
83
+ "util",
84
+ "utils",
85
+ "core",
86
+ "ponyfill",
87
+ "polyfill",
88
+ "shim",
89
+ "is",
90
+ "detect",
91
+ "check"
92
+ ],
93
+ "license": "MIT",
94
+ "maintainers": [
95
+ {
96
+ "name": "sindresorhus",
97
+ "email": "sindresorhus@gmail.com"
98
+ }
99
+ ],
100
+ "name": "path-is-absolute",
101
+ "optionalDependencies": {},
102
+ "readme": "ERROR: No README data found!",
103
+ "repository": {
104
+ "type": "git",
105
+ "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
106
+ },
107
+ "scripts": {
108
+ "test": "xo && node test.js"
109
+ },
110
+ "version": "1.0.1"
111
+ }
@@ -0,0 +1,59 @@
1
+ # path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
2
+
3
+ > Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com)
4
+
5
+
6
+ ## Install
7
+
8
+ ```
9
+ $ npm install --save path-is-absolute
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ const pathIsAbsolute = require('path-is-absolute');
17
+
18
+ // Running on Linux
19
+ pathIsAbsolute('/home/foo');
20
+ //=> true
21
+ pathIsAbsolute('C:/Users/foo');
22
+ //=> false
23
+
24
+ // Running on Windows
25
+ pathIsAbsolute('C:/Users/foo');
26
+ //=> true
27
+ pathIsAbsolute('/home/foo');
28
+ //=> false
29
+
30
+ // Running on any OS
31
+ pathIsAbsolute.posix('/home/foo');
32
+ //=> true
33
+ pathIsAbsolute.posix('C:/Users/foo');
34
+ //=> false
35
+ pathIsAbsolute.win32('C:/Users/foo');
36
+ //=> true
37
+ pathIsAbsolute.win32('/home/foo');
38
+ //=> false
39
+ ```
40
+
41
+
42
+ ## API
43
+
44
+ See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
45
+
46
+ ### pathIsAbsolute(path)
47
+
48
+ ### pathIsAbsolute.posix(path)
49
+
50
+ POSIX specific version.
51
+
52
+ ### pathIsAbsolute.win32(path)
53
+
54
+ Windows specific version.
55
+
56
+
57
+ ## License
58
+
59
+ MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -0,0 +1,15 @@
1
+ The ISC License
2
+
3
+ Copyright (c) Isaac Z. Schlueter and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,101 @@
1
+ [![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)
2
+
3
+ The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
4
+
5
+ Install with `npm install rimraf`, or just drop rimraf.js somewhere.
6
+
7
+ ## API
8
+
9
+ `rimraf(f, [opts], callback)`
10
+
11
+ The first parameter will be interpreted as a globbing pattern for files. If you
12
+ want to disable globbing you can do so with `opts.disableGlob` (defaults to
13
+ `false`). This might be handy, for instance, if you have filenames that contain
14
+ globbing wildcard characters.
15
+
16
+ The callback will be called with an error if there is one. Certain
17
+ errors are handled for you:
18
+
19
+ * Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
20
+ `opts.maxBusyTries` times before giving up, adding 100ms of wait
21
+ between each attempt. The default `maxBusyTries` is 3.
22
+ * `ENOENT` - If the file doesn't exist, rimraf will return
23
+ successfully, since your desired outcome is already the case.
24
+ * `EMFILE` - Since `readdir` requires opening a file descriptor, it's
25
+ possible to hit `EMFILE` if too many file descriptors are in use.
26
+ In the sync case, there's nothing to be done for this. But in the
27
+ async case, rimraf will gradually back off with timeouts up to
28
+ `opts.emfileWait` ms, which defaults to 1000.
29
+
30
+ ## options
31
+
32
+ * unlink, chmod, stat, lstat, rmdir, readdir,
33
+ unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
34
+
35
+ In order to use a custom file system library, you can override
36
+ specific fs functions on the options object.
37
+
38
+ If any of these functions are present on the options object, then
39
+ the supplied function will be used instead of the default fs
40
+ method.
41
+
42
+ Sync methods are only relevant for `rimraf.sync()`, of course.
43
+
44
+ For example:
45
+
46
+ ```javascript
47
+ var myCustomFS = require('some-custom-fs')
48
+
49
+ rimraf('some-thing', myCustomFS, callback)
50
+ ```
51
+
52
+ * maxBusyTries
53
+
54
+ If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered
55
+ on Windows systems, then rimraf will retry with a linear backoff
56
+ wait of 100ms longer on each try. The default maxBusyTries is 3.
57
+
58
+ Only relevant for async usage.
59
+
60
+ * emfileWait
61
+
62
+ If an `EMFILE` error is encountered, then rimraf will retry
63
+ repeatedly with a linear backoff of 1ms longer on each try, until
64
+ the timeout counter hits this max. The default limit is 1000.
65
+
66
+ If you repeatedly encounter `EMFILE` errors, then consider using
67
+ [graceful-fs](http://npm.im/graceful-fs) in your program.
68
+
69
+ Only relevant for async usage.
70
+
71
+ * glob
72
+
73
+ Set to `false` to disable [glob](http://npm.im/glob) pattern
74
+ matching.
75
+
76
+ Set to an object to pass options to the glob module. The default
77
+ glob options are `{ nosort: true, silent: true }`.
78
+
79
+ Glob version 6 is used in this module.
80
+
81
+ Relevant for both sync and async usage.
82
+
83
+ * disableGlob
84
+
85
+ Set to any non-falsey value to disable globbing entirely.
86
+ (Equivalent to setting `glob: false`.)
87
+
88
+ ## rimraf.sync
89
+
90
+ It can remove stuff synchronously, too. But that's not so good. Use
91
+ the async API. It's better.
92
+
93
+ ## CLI
94
+
95
+ If installed with `npm install rimraf -g` it can be used as a global
96
+ command `rimraf <path> [<path> ...]` which is useful for cross platform support.
97
+
98
+ ## mkdirp
99
+
100
+ If you need to create a directory recursively, check out
101
+ [mkdirp](https://github.com/substack/node-mkdirp).
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ var rimraf = require('./')
4
+
5
+ var help = false
6
+ var dashdash = false
7
+ var noglob = false
8
+ var args = process.argv.slice(2).filter(function(arg) {
9
+ if (dashdash)
10
+ return !!arg
11
+ else if (arg === '--')
12
+ dashdash = true
13
+ else if (arg === '--no-glob' || arg === '-G')
14
+ noglob = true
15
+ else if (arg === '--glob' || arg === '-g')
16
+ noglob = false
17
+ else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
18
+ help = true
19
+ else
20
+ return !!arg
21
+ })
22
+
23
+ if (help || args.length === 0) {
24
+ // If they didn't ask for help, then this is not a "success"
25
+ var log = help ? console.log : console.error
26
+ log('Usage: rimraf <path> [<path> ...]')
27
+ log('')
28
+ log(' Deletes all files and folders at "path" recursively.')
29
+ log('')
30
+ log('Options:')
31
+ log('')
32
+ log(' -h, --help Display this usage info')
33
+ log(' -G, --no-glob Do not expand glob patterns in arguments')
34
+ log(' -g, --glob Expand glob patterns in arguments (default)')
35
+ process.exit(help ? 0 : 1)
36
+ } else
37
+ go(0)
38
+
39
+ function go (n) {
40
+ if (n >= args.length)
41
+ return
42
+ var options = {}
43
+ if (noglob)
44
+ options = { glob: false }
45
+ rimraf(args[n], options, function (er) {
46
+ if (er)
47
+ throw er
48
+ go(n+1)
49
+ })
50
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "_args": [
3
+ [
4
+ {
5
+ "raw": "rimraf",
6
+ "scope": null,
7
+ "escapedName": "rimraf",
8
+ "name": "rimraf",
9
+ "rawSpec": "",
10
+ "spec": "latest",
11
+ "type": "tag"
12
+ },
13
+ "/Users/tomascelizna/Devel/dragonfly_chrome_headless"
14
+ ]
15
+ ],
16
+ "_from": "rimraf@latest",
17
+ "_id": "rimraf@2.6.1",
18
+ "_inCache": true,
19
+ "_location": "/rimraf",
20
+ "_nodeVersion": "8.0.0-pre",
21
+ "_npmOperationalInternal": {
22
+ "host": "packages-18-east.internal.npmjs.com",
23
+ "tmp": "tmp/rimraf-2.6.1.tgz_1487908074285_0.8205490333493799"
24
+ },
25
+ "_npmUser": {
26
+ "name": "isaacs",
27
+ "email": "i@izs.me"
28
+ },
29
+ "_npmVersion": "4.3.0",
30
+ "_phantomChildren": {},
31
+ "_requested": {
32
+ "raw": "rimraf",
33
+ "scope": null,
34
+ "escapedName": "rimraf",
35
+ "name": "rimraf",
36
+ "rawSpec": "",
37
+ "spec": "latest",
38
+ "type": "tag"
39
+ },
40
+ "_requiredBy": [
41
+ "#USER"
42
+ ],
43
+ "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
44
+ "_shasum": "c2338ec643df7a1b7fe5c54fa86f57428a55f33d",
45
+ "_shrinkwrap": null,
46
+ "_spec": "rimraf",
47
+ "_where": "/Users/tomascelizna/Devel/dragonfly_chrome_headless",
48
+ "author": {
49
+ "name": "Isaac Z. Schlueter",
50
+ "email": "i@izs.me",
51
+ "url": "http://blog.izs.me/"
52
+ },
53
+ "bin": {
54
+ "rimraf": "./bin.js"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/isaacs/rimraf/issues"
58
+ },
59
+ "dependencies": {
60
+ "glob": "^7.0.5"
61
+ },
62
+ "description": "A deep deletion module for node (like `rm -rf`)",
63
+ "devDependencies": {
64
+ "mkdirp": "^0.5.1",
65
+ "tap": "^10.1.2"
66
+ },
67
+ "directories": {},
68
+ "dist": {
69
+ "shasum": "c2338ec643df7a1b7fe5c54fa86f57428a55f33d",
70
+ "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz"
71
+ },
72
+ "files": [
73
+ "LICENSE",
74
+ "README.md",
75
+ "bin.js",
76
+ "rimraf.js"
77
+ ],
78
+ "gitHead": "d84fe2cc6646d30a401baadcee22ae105a2d4909",
79
+ "homepage": "https://github.com/isaacs/rimraf#readme",
80
+ "license": "ISC",
81
+ "main": "rimraf.js",
82
+ "maintainers": [
83
+ {
84
+ "name": "isaacs",
85
+ "email": "i@izs.me"
86
+ }
87
+ ],
88
+ "name": "rimraf",
89
+ "optionalDependencies": {},
90
+ "readme": "ERROR: No README data found!",
91
+ "repository": {
92
+ "type": "git",
93
+ "url": "git://github.com/isaacs/rimraf.git"
94
+ },
95
+ "scripts": {
96
+ "test": "tap test/*.js"
97
+ },
98
+ "version": "2.6.1"
99
+ }