tar-npm-modules
v1.0.2
Published
The project is able to archive node_modules folder
Downloads
1
Maintainers
Readme
tar-npm-modules
The project uses tar. tar-npm-modules as a
project could be helpful if you want npm modules to be stored in the source
control system. The project uses a storage: ./modules
.
Compress
Compress npm modules. Each node module will be stored in unique compressed file
import {tarNpmFolders} from 'tar-npm-modules'
;(async () => {
await tarNpmFolders()
})()
Compress npm modules in single file
import {tarNpmFolderSingleFile} from 'tar-npm-modules'
;(async () => {
// The script will create a new file ./.modules folder
// The output file will be: ./.modules/demo.tgz
await tarNpmFolderSingleFile('demo')
})()
Decompression: If node_modules are stored as multiple compressed files
import {unzipNpmModules} from 'tar-npm-modules'
;(async () => {
const path = './custom_node_modules'
unzipNpmModules(path)
})()
Decompression: If node_modules are stored in the signle file
import {unzipSingleFile} from 'tar-npm-modules'
;(async () => {
const fileLocation = './.modules/demo.tgz'
const path = './custom_node_modules'
await unzipSingleFile(fileLocation, path)
})()