]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: original-fs module
authorCheng Zhao <zcbenz@gmail.com>
Wed, 12 Nov 2014 03:58:03 +0000 (11:58 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 12 Nov 2014 03:58:03 +0000 (11:58 +0800)
docs/tutorial/application-packaging.md

index 423162443fd7f3b8858ba24e088cdf98ead55194..a2dd5dabca151d15d23e4b133b2f57e0ef577f4a 100644 (file)
@@ -95,6 +95,17 @@ var win = new BrowserWindow({width: 800, height: 600});
 win.loadUrl('asar:/path/to/example.asar/static/index.html');
 ```
 
+### Treating `asar` archive as normal file
+
+For some cases like verifying the `asar` archive's checksum, we need to read the
+content of `asar` archive as file. For this purpose you can use the built-in
+`original-fs` module which provides original `fs` APIs without `asar` support:
+
+```javascript
+var originalFs = require('original-fs');
+originalFs.readFileSync('/path/to/example.asar');
+```
+
 ## Limitations on Node API
 
 Even though we tried hard to make `asar` archives in the Node API work like