From cafa1bfebbb0acbe5c4609ee7b0182a5c1b662ba Mon Sep 17 00:00:00 2001 From: Amitesh Kumar Date: Fri, 14 Oct 2016 12:09:50 +0530 Subject: [PATCH] Saving text using with require statement --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 4cb9293..f340635 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,13 @@ Pass `true` for `disableAutoBOM` if you don't want FileSaver.js to automatically Examples -------- +### Saving text using with require +```js +var FileSaver = require('file-saver'); +var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); +FileSaver.saveAs(blob, "hello world.txt"); +``` + ### Saving text ```js