Skip to content

yulioaj290/npm-uploader-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

NPM Uploader Script

Script Bash for uploading NPM pachages to npmjs.com.

You must pass 2 required arguments:

  • prefix name of the packages;
  • weight of package chunks;
  • ziplevel of compression for the complete package and;
  • name of the file/directory/URL list to include on the packages.

This script is capable to upload all packages to npmjs.com secuencially and to remove the same packages if it is executed again immediately, following the information on the "remove.lock" file created previously.

Requirements


  • NodeJS 8.4.0 or higher.
  • NPM 5.3.0 or higher.
  • P7zip-full 16.02 or higher.

To prepare the environment for the script follow this steps (based on Ubuntu 14.04):

  1. (Optional) Update your linux repositories and upgrade all packages.
$ sudo apt-get update
$ sudo apt-get upgrade
  1. Install p7zip-full on your system, it is neccesary to compress and divide in chunks all the file/directory included.
$ sudo apt-get install p7zip-full
  1. Install NodeJS.
$ sudo apt-get install nodejs
  1. Execute the script.
$ bash NPM_UPLOADER.sh -link -unzip video.mp4 video-clip 50 9

Usage of the Script


Examples

$ bash NPM_UPLOADER.sh -link -unzip -rm -push video-clip 50 9 "video.mp4"
$ bash NPM_UPLOADER.sh -url -link -unzip -rm -push video-clip 50 9 "http://mi.website.com/my-book.pdf"
$ bash NPM_UPLOADER.sh -link -unzip -rm -push video-clip 50 9 "video.mp4" "my-book.pdf" "my-document.docx"
$ bash NPM_UPLOADER.sh -url -link -unzip -rm video-clip 50 9 "http://mi.website.com/video.mp4" "http://mi.website.com/my-book.pdf"
$ bash NPM_UPLOADER.sh -url -link -unzip -rm -gitclon -depsnpm my-project 50 9 "http://github.com/user/my-project.git"
$ bash NPM_UPLOADER.sh -unpush "video-clip_3"

Required arguments

  • NPM_UPLOADER.sh: Name of the script file.
  • video-clip: Name prefix of the packages to upload.
  • 50: Upper limit of the size of the packages to upload. It must be expressed in MegaBytes (MB).
  • 9: Level of compression of the packages to upload. It must be between 1 (min compression) and 9 (max compression).
  • video.mp4 or video.mp4 my-book.pdf: List of files to upload to npmjs.com as package(s).
  • video-clip_3: Prefix and chunks number to unpublish from npmjs.com.

Optional arguments

  • -url: Indicate that the file must be downloaded from the given URL (http://mi.website.com/video.mp4), and then build package.
  • -link: Include packages from 2nd to n(th) as dependencies of the 1st.
  • -rm: Remove all original files automatically. Must be used with the '-push' option.
  • -push: Publish all packages to 'npmjs.com' automatically. It requires to be loged in NPM in current terminal.
  • -unzip: Include a script into the 1st package to automatically UnZip the packages. Must be used with the '-link' option.
  • -unpush: Automatically unpublish the given chunks package from npmjs.com, and remove it from the "remove.lock" file.
  • -gitclon: Download from Git Repository through "git clone" command.
  • -depsnpm: Install dependencies from NPM Registries to the project downloaded from Git Repository.
  • -depsyarn: Install dependencies from YARN Registries to the project downloaded from Git Repository.

About

Script Bash for uploading NPM pachages to npmjs.com.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages