Menu
×

Được chứng nhận

Ghi lại kiến ​​thức của bạn

Đăng nhập Đăng ký

Tạo Tài khoản Example.com.vn miễn phí để cải thiện trải nghiệm học tập của bạn

Người tìm đường và việc học của tôi

Theo dõi tiến độ học tập của bạn tại Example.com.vn và thu thập phần thưởng

Nâng cấp

Trở thành người dùng PLUS và mở khóa các tính năng mạnh mẽ (không có quảng cáo, lưu trữ, hỗ trợ, ..)

Bắt đầu từ đâu

Bạn không chắc chắn muốn bắt đầu từ đâu? Đi theo con đường được hướng dẫn của chúng tôi

Trình chỉnh sửa mã (Dùng thử)

Với trình chỉnh sửa mã trực tuyến của chúng tôi, bạn có thể chỉnh sửa mã và xem kết quả trong trình duyệt của mình

Video

Tìm hiểu những điều cơ bản về HTML qua video hướng dẫn thú vị và hấp dẫn

Mẫu

Chúng tôi đã tạo một loạt mẫu trang web đáp ứng mà bạn có thể sử dụng - miễn phí!

Web hosting

Lưu trữ trang web của riêng bạn và chia sẻ nó với mọi người với Example.com.vn Spaces

Tạo một máy chủ

Tạo máy chủ của riêng bạn bằng Python, PHP, React.js, Node.js, Java, C#, v.v.

Làm thế nào để

Bộ sưu tập lớn các đoạn mã cho HTML, CSS và JavaScript

Khung CSS

Xây dựng các trang web nhanh và phản hồi bằng cách sử dụng khung W3.CSS miễn phí của chúng tôi

Thống kê trình duyệt

Đọc xu hướng dài hạn của việc sử dụng trình duyệt

Tốc độ gõ

Kiểm tra tốc độ đánh máy của bạn

Đào tạo AWS

Tìm hiểu dịch vụ web của Amazon

Bộ chọn màu

Sử dụng công cụ chọn màu của chúng tôi để tìm các màu RGB, HEX và HSL khác nhau. Bánh xe màu hình tròn thể hiện sự chuyển màu trong quang phổ

Trò chơi mã

Trò chơi mã hóa W3Schools! Giúp linh miêu thu thập nón thông Logo Lynx

Đặt mục tiêu

Nhận hành trình học tập được cá nhân hóa dựa trên các kỹ năng và mục tiêu hiện tại của bạn

Bản tin

Tham gia bản tin của chúng tôi và có quyền truy cập vào nội dung độc quyền mỗi tháng

Việc làm

Thuê những tài năng công nghệ hàng đầu. Hợp lý hóa quy trình tuyển dụng của bạn để có đội ngũ phù hợp hoàn hảo

Lớp học

Hãy liên hệ để sử dụng Example.com.vn Plus và các chứng chỉ với tư cách là một tổ chức giáo dục

×
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP CÁCH W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS AN NINH MẠNG DỮ LIỆU KHOA HỌC

Mô-đun hệ thống tệp Node.js

❮ Mô-đun tích hợp


Ví dụ

Mở một tệp và xuất nội dung:

var fs = require('fs');

fs.readFile('demofile.txt', 'utf8', function(err, data) {
  if (err) throw err;
  console.log(data);
});
Chạy ví dụ »

Định nghĩa và cách sử dụng

Mô-đun Hệ thống tệp cung cấp cách làm việc với hệ thống tệp của máy tính.


Cú pháp

Cú pháp để đưa mô-đun Hệ thống tệp vào ứng dụng của bạn:

var fs = require('fs');

Phương pháp hệ thống tập tin

Method Description
access() Checks if a user has access to this file or directory
accessSync() Same as access(), but synchronous instead of asynchronous
appendFile() Appends data to a file
appendFileSync() Same as appendFile(), but synchronous instead of asynchronous
chmod() Changes the mode of a file
chmodSync() Same as chmod(), but synchronous instead of asynchronous
chown() Changes the owner of a file
chownSync() Same as chown(), but synchronous instead of asynchronous
close() Closes a file
closeSync() Same as close(), but synchronous instead of asynchronous
constants Returns an object containing constant values for the file system
createReadStream() Returns a new stream object
createWriteStream() Returns a new writeable stream object
exists() Deprecated. Checks if a file or folder exists
existsSync() Same as exists(), but synchronous instead of asynchronous. This method is NOT deprecated
fchmod() Changes the mode of a file
fchmodSync() Same as fchmod(), but synchronous instead of asynchronous
fchown() Changes the owner of a file
fchownSync() Same as fchown(), but synchronous instead of asynchronous
fdatasync() Syncronizes a file with the one stored on the computer
fdatasyncSync() Same as fdatasync(), but synchronous instead of asynchronous
fstat() Returns the status of a file
fstatSync() Same as fstat(), but synchronous instead of asynchronous
fsync() Syncronizes a file with the one stored on the computer
fsyncSync() Same as fsync(), but synchronous instead of asynchronous
ftruncated() Truncates a file
ftruncatedSync() Same as ftruncated(), but synchronous instead of asynchronous
futimes() Change the timestamp of a file
futimesSync() Same as futimes(), but synchronous instead of asynchronous
lchmod() Changes the mode of a file, for Mac OS X
lchmodSync() Same as lchmod(), but synchronous instead of asynchronous
lchown() Changes the owner of a file, for Mac OS X
lchownSync() Same as lchown(), but synchronous instead of asynchronous
link() Makes an addition name for a file. Both the old and the new name may be used
linksync() Same as link(), but synchronous instead of asynchronous
lstat() Returns the status of a file
lstatSync() Same as lstat(), but synchronous instead of asynchronous
mkdir() Makes a new directory
mkdirSync() Same as mkdir(), but synchronous instead of asynchronous
mkdtemp() Makes a new temporary directory
mkdtempSync() Same as mktemp(), but synchronous instead of asynchronous
open() Opens a file
openSync() Same as open(), but synchronous instead of asynchronous
read() Reads the content of a file
readdir() Reads the content of a directory
readdirSync() Same as readdir(), but synchronous instead of asynchronous
readFile() Reads the content of a file
readFileSync() Same as readFile(), but synchronous instead of asynchronous
readlink() Reads the value of a link
readlinkSync() Same as readlink(), but synchronous instead of asynchronous
realpath() Returns the absolute pathname
realpathSync() Same as realpath(), but synchronous instead of asynchronous
rename() Renames a file
renameSync() Same as rename(), but synchronous instead of asynchronous
rmdir() Removes a directory
rmdirSync() Same as rmdir(), but synchronous instead of asynchronous
stat() Returns the status of a file
statSync() Same as stat(), but synchronous instead of asynchronous
symlink() Makes a symbolic name for a file
symlinkSync() Same as symlink(), but synchronous instead of asynchronous
truncate() Truncates a file
truncateSync() Same as truncate(), but synchronous instead of asynchronous
unlink() Removes a link
unlinkSync() Same as unlink(), but synchronous instead of asynchronous
unwatchFile() Stops watching for changes on a filename
utimes() Change the timestamp of a file
utimesSync() Same as utimes(), but synchronous instead of asynchronous
watch() Watch for changes of a filename or directoryname
watchFile() Watch for changes of a filename
write() Writes buffer to a file
write() Writes data to a file
writeFile() Writes data to a file
writeFileSync() Same as writeFile(), but synchronous instead of asynchronous
writeSync() Same as write(); writes buffer to a file synchronous instead of asynchronous
writeSync() Same as write(); writes data to a file synchronous instead of asynchronous

❮ Mô-đun tích hợp

×

Liên hệ bán hàng

Nếu bạn muốn sử dụng dịch vụ của Example.com.vn với tư cách là một tổ chức giáo dục, nhóm hoặc doanh nghiệp, hãy gửi email cho chúng tôi:
[email được bảo vệ]

Báo cáo lỗi

Nếu bạn muốn báo cáo lỗi hoặc nếu bạn muốn đưa ra đề xuất, hãy gửi email cho chúng tôi:
[email được bảo vệ]

Example.com.vn được tối ưu hóa cho việc học tập và đào tạo. Các ví dụ có thể được đơn giản hóa để cải thiện khả năng đọc và học. Các hướng dẫn, tài liệu tham khảo và ví dụ liên tục được xem xét để tránh sai sót, nhưng chúng tôi không thể đảm bảo tính chính xác hoàn toàn của mọi nội dung. Trong khi sử dụng W3Schools, bạn đồng ý đã đọc và chấp nhận các điều khoản sử dụng , chính sách cookie và quyền riêng tư của chúng tôi.

Bản quyền 1999-2024 của Refsnes Data. Đã đăng ký Bản quyền. Example.com.vn được cung cấp bởi W3.CSS .