Skip to content

Instantly share code, notes, and snippets.

@subhanshuja
Last active November 10, 2020 09:29
Show Gist options
  • Save subhanshuja/e7906aad0083c4a58485ef704e926e2b to your computer and use it in GitHub Desktop.
Save subhanshuja/e7906aad0083c4a58485ef704e926e2b to your computer and use it in GitHub Desktop.
download file modern js without npm using bash
#ref: https://gist.github.com/hrwgc/7455343
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
}
# file list of url
file="listlib.txt"
while IFS= read -r line; do
if `validate_url $line > /dev/null`; then wget $line -P /path/lib/; else echo "doesn't exist"; fi
done < "$file"
https://unpkg.com/react@16/umd/react.development.js
https://unpkg.com/react-dom@16/umd/react-dom.development.js
https://unpkg.com/[email protected]/babel.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment