i am create a npm package and i want date-npm package for my npm package how to include this package to my npm package,any way?
Asked
Active
Viewed 160 times
1
-
1Isn't it enough to just mention it in package.json in `dependencies` section? – Anatoly Aug 27 '20 at 17:56
-
1@Anatoly i think my npm package is for publishing, and how i include the date package to my package,how to do that?itspossible – Andrew Aug 27 '20 at 18:06
-
1Do you wish to include the whole code of date-npm? Why? If you indicate date-npm as a dependency then during someone installs your package there will be installed all dependencies as well. – Anatoly Aug 27 '20 at 18:17
-
@Anatoly just see this https://stackoverflow.com/questions/63637054/how-to-merge-two-npm-packages-as-one this is my actual problem – Andrew Aug 29 '20 at 16:18
2 Answers
3
If you’re just building an npm library then just include date lib in your package.json dependencies. Once a user installs your lib, then npm will take care of the rest.

Edward Romero
- 2,905
- 1
- 5
- 17
0
Just execute
npm install date-npm
in your package.
Once your package is published, anyone installing your package, like:
npm install your-groovy-package-here
will have date-npm
, as well as any other dependencies your package might have, installed along with it.

Nicholas Carey
- 71,308
- 16
- 93
- 135
-
date-npm is not an actual package FYI, should fix to have a proper response to the question. – Edward Romero Aug 28 '20 at 20:46
-
@EdwardRomero: Perhaps you didn't read the actual question "i want `date-npm` package for my npm package how to include this package to my npm package,any way?". Whether or not `date-npm` is a package in the public NPM registry or not is irrelevant to the question or its answer. – Nicholas Carey Aug 28 '20 at 21:38
-
date-npm in question above links to the proper package in registry that OP wanted FYI. But anyways, I just wanted to make sure future developers don’t try to run your commands and get errors and down vote the answer. So up to you to update or not. – Edward Romero Aug 28 '20 at 21:54