2018-10-25 20:29:56 +02:00
---
id: 587d7fb3367417b2b2512bfc
title: Add a Description to Your package.json
challengeType: 2
2019-08-05 09:17:33 -07:00
forumTopicId: 301522
2021-01-13 03:31:00 +01:00
dashedName: add-a-description-to-your-package-json
2018-10-25 20:29:56 +02:00
---
2020-11-27 19:02:05 +01:00
# --description--
The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs.
2019-03-03 12:30:44 -06:00
If you some day plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, that’ s not the only use case for the description, it’ s a great way to summarize what a project does. It’ s just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly.
2020-11-27 19:02:05 +01:00
2019-03-03 12:30:44 -06:00
Regardless of what you plan for your project, a description is definitely recommended. Here's an example:
2019-05-14 05:00:06 -07:00
```json
"description": "A project that does something awesome",
```
2020-11-27 19:02:05 +01:00
# --instructions--
2018-10-25 20:29:56 +02:00
2020-11-27 19:02:05 +01:00
Add a `description` to the package.json file of your project.
2018-10-25 20:29:56 +02:00
2020-11-27 19:02:05 +01:00
**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields.
2018-10-25 20:29:56 +02:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-10-25 20:29:56 +02:00
2020-11-27 19:02:05 +01:00
package.json should have a valid "description" key
2018-10-25 20:29:56 +02:00
2020-11-27 19:02:05 +01:00
```js
(getUserInput) =>
$.get(getUserInput('url') + '/_api/package.json').then(
(data) => {
var packJson = JSON.parse(data);
assert(packJson.description, '"description" is missing');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
```
2018-10-25 20:29:56 +02:00
2020-11-27 19:02:05 +01:00
# --solutions--
2018-10-25 20:29:56 +02:00
```js
2019-10-24 10:08:13 +05:30
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
2018-10-25 20:29:56 +02:00
```