Submit Search
Upload
Node.js File system & Streams
•
Download as PPTX, PDF
•
2 likes
•
2,715 views
Eyal Vardi
Follow
Node.js File system & Streams
Read less
Read more
Technology
Report
Share
Report
Share
1 of 18
Download now
Recommended
Nodejs buffers
Nodejs buffers
monikadeshmane
Node.js Express
Node.js Express
Eyal Vardi
Express node js
Express node js
Yashprit Singh
Express JS
Express JS
Designveloper
Node.js Event Emitter
Node.js Event Emitter
Eyal Vardi
Expressjs
Expressjs
Yauheni Nikanovich
Build RESTful API Using Express JS
Build RESTful API Using Express JS
Cakra Danu Sedayu
JavaScript Promises
JavaScript Promises
L&T Technology Services Limited
Recommended
Nodejs buffers
Nodejs buffers
monikadeshmane
Node.js Express
Node.js Express
Eyal Vardi
Express node js
Express node js
Yashprit Singh
Express JS
Express JS
Designveloper
Node.js Event Emitter
Node.js Event Emitter
Eyal Vardi
Expressjs
Expressjs
Yauheni Nikanovich
Build RESTful API Using Express JS
Build RESTful API Using Express JS
Cakra Danu Sedayu
JavaScript Promises
JavaScript Promises
L&T Technology Services Limited
File system node js
File system node js
monikadeshmane
Express js
Express js
Manav Prasad
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
Java Script ppt
Java Script ppt
Priya Goyal
Javascript essentials
Javascript essentials
Bedis ElAchèche
JavaScript Fetch API
JavaScript Fetch API
Xcat Liu
JavaScript Event Loop
JavaScript Event Loop
Designveloper
Sharing Data Between Angular Components
Sharing Data Between Angular Components
Squash Apps Pvt Ltd
Express JS
Express JS
Alok Guha
Asynchronous JavaScript Programming
Asynchronous JavaScript Programming
Haim Michael
Bootstrap.pptx
Bootstrap.pptx
vishal choudhary
Node js introduction
Node js introduction
Joseph de Castelnau
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
Wojciech Dzikowski
Javascript 101
Javascript 101
Shlomi Komemi
JS Event Loop
JS Event Loop
Saai Vignesh P
Introduction to RxJS
Introduction to RxJS
Brainhub
Vue js for beginner
Vue js for beginner
Chandrasekar G
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Thymeleaf
JavaScript
JavaScript
Vidyut Singhania
Spring Boot
Spring Boot
Jiayun Zhou
Node.js Socket.IO
Node.js Socket.IO
Eyal Vardi
Node js overview
Node js overview
Eyal Vardi
More Related Content
What's hot
File system node js
File system node js
monikadeshmane
Express js
Express js
Manav Prasad
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
Java Script ppt
Java Script ppt
Priya Goyal
Javascript essentials
Javascript essentials
Bedis ElAchèche
JavaScript Fetch API
JavaScript Fetch API
Xcat Liu
JavaScript Event Loop
JavaScript Event Loop
Designveloper
Sharing Data Between Angular Components
Sharing Data Between Angular Components
Squash Apps Pvt Ltd
Express JS
Express JS
Alok Guha
Asynchronous JavaScript Programming
Asynchronous JavaScript Programming
Haim Michael
Bootstrap.pptx
Bootstrap.pptx
vishal choudhary
Node js introduction
Node js introduction
Joseph de Castelnau
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
Wojciech Dzikowski
Javascript 101
Javascript 101
Shlomi Komemi
JS Event Loop
JS Event Loop
Saai Vignesh P
Introduction to RxJS
Introduction to RxJS
Brainhub
Vue js for beginner
Vue js for beginner
Chandrasekar G
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Thymeleaf
JavaScript
JavaScript
Vidyut Singhania
Spring Boot
Spring Boot
Jiayun Zhou
What's hot
(20)
File system node js
File system node js
Express js
Express js
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
Java Script ppt
Java Script ppt
Javascript essentials
Javascript essentials
JavaScript Fetch API
JavaScript Fetch API
JavaScript Event Loop
JavaScript Event Loop
Sharing Data Between Angular Components
Sharing Data Between Angular Components
Express JS
Express JS
Asynchronous JavaScript Programming
Asynchronous JavaScript Programming
Bootstrap.pptx
Bootstrap.pptx
Node js introduction
Node js introduction
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
Javascript 101
Javascript 101
JS Event Loop
JS Event Loop
Introduction to RxJS
Introduction to RxJS
Vue js for beginner
Vue js for beginner
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
JavaScript
JavaScript
Spring Boot
Spring Boot
Viewers also liked
Node.js Socket.IO
Node.js Socket.IO
Eyal Vardi
Node js overview
Node js overview
Eyal Vardi
Angular 2.0 forms
Angular 2.0 forms
Eyal Vardi
Angular 2.0 Views
Angular 2.0 Views
Eyal Vardi
Modules and injector
Modules and injector
Eyal Vardi
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Eyal Vardi
Angular 2.0 Pipes
Angular 2.0 Pipes
Eyal Vardi
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Eyal Vardi
Node.js Spplication Scaling
Node.js Spplication Scaling
Eyal Vardi
Angular 2 NgModule
Angular 2 NgModule
Eyal Vardi
Routing And Navigation
Routing And Navigation
Eyal Vardi
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Eyal Vardi
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Eyal Vardi
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Eyal Vardi
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Eyal Vardi
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Eyal Vardi
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Eyal Vardi
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Eyal Vardi
Viewers also liked
(20)
Node.js Socket.IO
Node.js Socket.IO
Node js overview
Node js overview
Angular 2.0 forms
Angular 2.0 forms
Angular 2.0 Views
Angular 2.0 Views
Modules and injector
Modules and injector
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Angular 2.0 Pipes
Angular 2.0 Pipes
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Node.js Spplication Scaling
Node.js Spplication Scaling
Angular 2 NgModule
Angular 2 NgModule
Routing And Navigation
Routing And Navigation
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
More from Eyal Vardi
Why magic
Why magic
Eyal Vardi
Smart Contract
Smart Contract
Eyal Vardi
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Eyal Vardi
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Eyal Vardi
Angular 2 Architecture
Angular 2 Architecture
Eyal Vardi
Proxies in ECMAScript 6.0
Proxies in ECMAScript 6.0
Eyal Vardi
Iterators & Generators in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Eyal Vardi
Symbols in ECMAScript 6.0
Symbols in ECMAScript 6.0
Eyal Vardi
Objects & Classes in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Eyal Vardi
Scope & Functions in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
Eyal Vardi
AngularJS Internal
AngularJS Internal
Eyal Vardi
More from Eyal Vardi
(11)
Why magic
Why magic
Smart Contract
Smart Contract
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture
Angular 2 Architecture
Proxies in ECMAScript 6.0
Proxies in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Symbols in ECMAScript 6.0
Symbols in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
AngularJS Internal
AngularJS Internal
Recently uploaded
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Roshan Dwivedi
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
V3cube
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Delhi Call girls
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Recently uploaded
(20)
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Node.js File system & Streams
1.
2.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
3.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
4.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
5.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var path = require("path");
6.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var fs = require("fs");
7.
8.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
9.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var Stream = require("stream"); var stream = new Stream(); var duration = 5 * 1000; // 5 seconds var end = Date.now() + duration; var interval; stream.readable = true; interval = setInterval(function () { console.log("Emitting a data event"); stream.emit("data", new Buffer("foo")); if (Date.now() >= end) { console.log("Emitting an end event"); stream.emit("end"); clearInterval(interval); } }, 1000);
10.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
11.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com crypto streams tcp sockets child process stdout and stderr process.stdin
12.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
13.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var fs = require("fs"); var stream; stream = fs.createReadStream(__dirname + "/foo.txt"); stream.on("data", function (data) { var chunk = data.toString(); process.stdout.write(chunk); }); stream.on("end", function() { console.log(); });
14.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var fs = require("fs"); var readStream = fs.createReadStream(__dirname + "/foo.txt"); var writeStream = fs.createWriteStream(__dirname + "/bar.txt"); readStream.pipe(writeStream);
15.
var fs =
require("fs"); var zlib = require("zlib"); var gzip = zlib.createGzip(); var input = fs.createReadStream("input.txt"); var output = fs.createWriteStream("input.txt.gz"); input .pipe(gzip) .pipe(output);
16.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com Use-case Class Method(s) to implement Reading only Readable _read Writing only Writable _write Reading and writing Duplex _read, _write Operate on written data, then read the result Transform _transform, _flush
17.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var Readable = require('stream').Readable; var util = require('util'); util.inherits(Counter, Readable); function Counter(opt) { Readable.call(this, opt); this._max = 1000000; this._index = 1; } Counter.prototype._read = function () { var i = this._index++; if (i > this._max) this.push(null); else { var str = '' + i; var buf = new Buffer(str, 'ascii'); this.push(buf); } };
Download now