I
I
ivandao2019-09-26 11:16:26
JavaScript
ivandao, 2019-09-26 11:16:26

How to create a package.json for a finished project?

Is there a tool to automatically generate package.json from a finished project?
Interested in listing the modules used and their versions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2019-09-26
@Casufi

I just tried to do the following
1) Created an empty temp folder
2) cd temp
3) npm install webpack-dev-server
4) As a result, there is no package.json in the folder, but there is package-lock.json
5) I did npm init as a result I got a package .json with section
5a) For fun, I deleted package-lock.json and package.json and did npm init again and got the same section as a result

"dependencies": {
    "webpack-dev-server": "^3.8.1"
  },

So it looks like just npm init should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question