Node2 Valora esta página Bienvenido al test sobre Node.js Para comenzar pulsa sobre el botón de Iniciar.Dispones de 15 minutos para responder el mayor número posible de respuestas correctas.Las preguntas tendrán una única respuesta correcta.Si has terminado el test antes del tiempo establecido, pulsa el botón Finalizar para enviarlo. Para comenzar el test, completa tus datos y pulsa el botón "Siguiente" Nombre completo Email 1 { name: 'Jane' } {'Jane'} {} Jane 2 The current thread will block until the executon is completed and the operating system will spawn new threads to handle incoming requests. This can exhaust the number of allowed threads (255) and degrade performance over time. As Node.js is asynchronous, this is handled by a libuv and a threadpool. The performance will not notably degrade. As Node.js is asynchronous, this is handled by a threadpool and the performance will not notably degrade. As the application code runs asynchronously within a single thread, the execution will block, accepting no more requests until the operation is completed. 3 only functions only variables and arrays functions, objects, arrays, or anything you assign to the module only objects 4 console logs system information creates a text file hello.txt and appends customized text creates a file named data and append numbers creates an image file 5 {'John'} {} John Undefined 6 exports, module, __filename, __dirname exports, process, require, module, __filename, __dirname exports, require, module, __filename, __dirname exports, __filename, __dirname 7 The event loop is single-threaded, but a JavaScript VM can use multiple threads JavaScript execution in Node.js is single-threaded, but I/O operations are executed using multiple threads Every Node process gets four threads that it can share between its JavaScript VM and the event loop Every Node process runs in a single thread, and all the I/O work is run in that same thread 8 an object representing an array that has five elements an empty string undefined ReferenceError: arguments is not defined 9 .history .break .editor .save 10 server running at http://localhost:3000/ server running at http://localhost:4000/ server running at http://127.0.0.1:3000/ server running at port 3000 11 util.date(value) util.types.isDate(value) assert.isDate(value) console.isDate(value) 12 __location __filename __pathname __flder 13 node -p "util.cpus().size" node -p "process.os.cpus" node -p "process.cpus" node -p "os.cpus().length" 14 --debug --chrome --inspect --dev-tools 15 The forked process shares the same VM thread with the parent process. A new VM instance is created and the two VM instances will be shared between the forked process and the parent process. The forked process will have its own VM instance. The forked process shares the event loop with the parent process 16 lookup resolve resolve4 reverse 17 a C++ Addon file that is built with node-gyp a JavaScript file that can have a .node extension as well as the .js extension a C++ file that can have a .node extension and that Node will be able to execute directly. a JSON file that can have a .node extension as well as the .json extension 18 node -v node -h node index.js -x node index.js -h 19 fork("ps -ef") exec("ps", "-ef") spawn("ps -ef") exec("ps -ef") 20 Copy the file into a database and perform the operations there Use readline together with streams to read and transform and write the file contents line by line Use regular expressions directly on the file Use Promises and async/await to offload the task to libuv 3 out of 2