tar-npm-modules

1.0.2 • Public • Published

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)
})()

Package Sidebar

Install

npm i tar-npm-modules

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

5.6 kB

Total Files

14

Last publish

Collaborators

  • dimityrdanailov