🪴 yshalsager's Digital Garden

Search

Search IconIcon to open search

Node.js Command Line Arguments

Last updated Nov 3, 2022

المعرفة:: NodeJS
الحالة:: #ملاحظة_مؤرشفة
المراجع:: The Complete Node.js Developer Course 3rd Edition


1
2
3
4
5
6
const command = process.argv[2]  
if (command === 'add') {  
	console.log('Adding note!')  
} else if (command === 'remove') {  
	console.log('Removing note!')  
}  
1
2
node app.js add  
# Adding note!