How to properly use the "keywords" property in package.json?
Is it good to list as many keywords for the package as possible (hundreds?), Or is it a bad approach?
How to list keywords correctly?
+3
GProst
source
to share
1 answer
Is it good to list as many keywords for the package as possible (hundreds?), Or is it a bad approach?
You should only use keywords that are specific to your module and that you expect people to use when searching for a module like yours.
So, if you have a module that uses twitter and has a promise based api, then you can use keywords like "twitter" and "promise", but you shouldn't use irrelevant keywords to spam search results.
I can't think of any legitimate reason to require many keywords.
How to list keywords correctly?
This is an example of my own caught module - which, as you can see, uses 4 keywords:
{
"name": "caught",
"version": "0.1.1",
"description": "Avoids UnhandledPromiseRejectionWarning and PromiseRejectionHandledWarning",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "bash test.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rsp/node-caught.git"
},
"keywords": [
"promise",
"async",
"UnhandledPromiseRejectionWarning",
"PromiseRejectionHandledWarning"
],
"author": "Rafał Pocztarski <r.pocztarski@gmail.com> (https://pocztarski.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/rsp/node-caught/issues"
},
"homepage": "https://github.com/rsp/node-caught#readme"
}
Cm:
- https://github.com/rsp/node-caught/blob/master/package.json#L14-L19
+5
rsp
source
to share