The Node.js Examples Initiative is looking for a qualified mentee to join the initiative.
License
License
file in the project rootbent
for all requestssemver
for version comparisons and other operationshbs
to render handlebars templatesRoutes
GET - /dependencies
This will retrieve all dependencies from the package.json
and render HTML using handlebars.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<ul>
<li>bent - ^7.3.7</li>
<li>express - ^4.17.1</li>
<li>hbs - ^4.1.1</li>
<li>semver - ^7.3.2</li>
</ul>
</body>
</html>
GET - /minimum-secure
This will return the minimum secure version for each release line as JSON. In other words, what is the highest version of each line that has security: true
.
{
"v0": {
"version": "v0.12.17",
"date": "2016-10-18",
"files": [],
"npm": "2.15.1",
"v8": "3.28.71.19",
"uv": "1.6.1",
"zlib": "1.2.8",
"openssl": "1.0.1u",
"modules": "14",
"lts": false,
"security": true
},
"v4": {
"version": "v4.9.0",
"date": "2018-03-28",
"files": [],
"npm": "2.15.11",
"v8": "4.5.103.53",
"uv": "1.9.1",
"zlib": "1.2.11",
"openssl": "1.0.2o",
"modules": "46",
"lts": "Argon",
"security": true
} ...
GET - /latest-releases
This will return the latest release version in each release line as JSON.
{
"v14": {
"version": "v14.7.0",
"date": "2020-07-29",
"files": [],
"npm": "6.14.7",
"v8": "8.4.371.19",
"uv": "1.38.1",
"zlib": "1.2.11",
"openssl": "1.1.1g",
"modules": "83",
"lts": false,
"security": false
},
"v13": {
"version": "v13.14.0",
"date": "2020-04-28",
"files": [],
"npm": "6.14.4",
"v8": "7.9.317.25",
"uv": "1.37.0",
"zlib": "1.2.11",
"openssl": "1.1.1g",
"modules": "79",
"lts": false,
"security": false
} ...
Tests
Each of the above endpoints should have its own tests. Use the provided test/index.js
file to get started and see below for example output.
Test Requirements:
tape
nock
to prevent live requests# should get dependencies
ok 1 should contain bent
ok 2 should contain express
ok 3 should contain hbs
# should get minimum secure versions
ok 4 v0 version should match
ok 5 v4 version should match
# should get latest-releases
ok 6 v14 version should match
ok 7 v13 version should match
git remote set-url origin ${your repo url}
Author: letxbeazero
Source Code: https://github.com/letxbeazero/nodejs-examples-initiative-challenge
#nodejs #node #javascript