A
A
Alexey Sharapov2017-07-04 18:16:11
Software Deployment
Alexey Sharapov, 2017-07-04 18:16:11

NodeJS to collect in one file?

Good day to everyone who reads!
I ask for a little hint - is it possible to build a NodeJS project with dependencies into a file, something like war / jar (like that)?
I only find information about creating an npm module, but this is not what I want.
The task is actually to collect this file and send it to the prod.
At the moment, sending files is implemented, let's say packed in a rar archive.
If there is such an opportunity, I will be grateful for a link or a resource with a description)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Yarkov, 2017-07-05
@SicYar

https://www.npmjs.com/package/pkg

D
Dark Hole, 2017-07-04
@abyrkov

is it possible to build a NodeJS project with dependencies into a file
There is an opportunity to collect in binarnik. If the weight, of course, does not bother you. There are archiving tools (don't confuse archiving with compression).
I'm still sure that it will be easier to download dependencies using NPM. Everything else is archived. tar, for example.
About NPM
Google:
- package.json
- npm init
- npm install
- npm install --save
Вот тут русским языком описано, что к чему. На Хабрахабре есть поподробнее. Кроме того, максимум подробностей есть в документации, собственно, NPM

I
Igor Kalashnikov, 2017-07-04
@zo0m

Take a look at webpack, get a js file as output

A
Anton Anton, 2017-07-04
@Fragster

I do this: project in git, settings in .gitignore (if they are stored in a file) and node_modules. All dependencies are in package.json. On prod I roll out directly from the master branch of the git, then npm install, then pm2 start/save/restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question