wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AY25S2 BED Diagnostic: npm + HTTP Routes

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

What is the file that lists dependencies and custom commands?

a)

package-lock.json

b)

node_modules

c)

index.js

d)

package.json

2.

Which npm command is used to download a package?

a)

npm run

b)

npm init

c)

npm start

d)

npm install

3.

Which npm command is used to execute a custom script named 'xxx' defined in your package.json?

a)
npm run xxx
b)
npm install xxx
c)
npm start xxx
d)

npm xxx

4.

Which npm command is used to remove a package from your project?

a)
npm remove
b)
npm uninstall
c)
npm delete
d)
npm purge
5.

Which HTTP method is used to retrieve information only?

a)
POST
b)
PUT
c)
DELETE
d)
GET
6.

Which HTTP method should be used to create a NEW user?

a)
POST
b)
PUT
c)
DELETE
d)
GET
7.

If you want to remove a blog post, which HTTP method should you use?

a)
POST
b)
PUT
c)
PATCH
d)
DELETE
8.

What is the Express.js syntax for a GET request to the root path (/)?

a)

app.run(...)

b)

app.get('/', (req, res) => { })

c)

app.post('/', (req, res)=>{ })

d)

app.listen('/', ...)

9.

Which Express method handles a POST request to /products?

a)

app.get('/products',
(req, res)=>{...})

b)

app.post('/products', (req, res)=>{...})

c)

app.put('/products',
(req, res)=>{...})

d)

app.delete('/products', ()=>{...})

10.

What does Unit 3 (this week's content) teach?

a)

HTTP Methods + Middleware

b)

Integration with Database

c)

Integration with Frontend

d)

I don't know