10 examples of 'angular min js download' in JavaScript

Every line of 'angular min js download' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
30function jcl_download(cb) {
31 console.log('Downloading the Java class library (big download, may take a while)');
32 process.chdir('vendor');
33 // Ubuntu (security) repo actual on 24.02.2013
34 exec('mktemp -d jdk-download.XXX', function(err, stdout, stderr){
35 DOWNLOAD_DIR = stdout.trim();
36 process.chdir(DOWNLOAD_DIR);
37 var DEBS_DOMAIN="http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-6";
38 var DEBS = [
39 "openjdk-6-jre-headless_6b27-1.12.6-1ubuntu0.12.04.4_i386.deb",
40 "openjdk-6-jdk_6b27-1.12.6-1ubuntu0.12.04.4_i386.deb",
41 "openjdk-6-jre-lib_6b27-1.12.6-1ubuntu0.12.04.4_all.deb"
42 ];
43 var request = require('request');
44 async.each(DEBS, function(deb, cb2){
45 var url = DEBS_DOMAIN + '/' + deb;
46 var file = fs.createWriteStream(deb);
47 request(url).pipe(file);
48 file.on('finish', function(){
49 file.close();
50 exec('ar p '+deb+' data.tar.gz | tar zx', function(err, stdout, stderr){
51 return cb2(err);
52 });
53 });
54 }, function(err){
55 process.chdir('..');
56 return cb(err);
57 });
58 });
59}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

20function download(name) {
21 const url = downloadDescription[name];
22 const targetFile = getTargetFileName(name);
23
24 return new Promise((resolve, reject) => {
25 console.log(chalk.cyan(`Downloading syntax ${name} ...`));
26 console.log(chalk.cyan.dim(` ${url}`));
27
28 request(url, {}, (err, response, body) => {
29 if (err) {
30 console.error(chalk.red(`Download failed! ${err.message}`));
31 console.error(chalk.red(err.stack));
32 return reject(err);
33 }
34 if (response.statusCode != 200) {
35 console.error(chalk.red(`Download failed! because the response code is not 200`));
36 console.error(chalk.red(` actual: ${response.statusCode} ${response.statusMessage}`));
37 return reject(new Error(`response code is not 200, but ${response.statusCode}`));
38 }
39
40 if (body instanceof Buffer)
41 body = body.toString('utf8');
42 console.log(chalk.green(`Download success! (length: ${body.length})`));
43
44 writeFile(targetFile, name, body);
45 console.log(chalk.green(`Written to "${targetFile}" success!`));
46
47 if (name == defaultSyntax) {
48 writeFile(defaultFileName, name, body);
49 console.log(chalk.green(`Written to "${defaultFileName}" success!`));
50 }
51 return resolve(body);
52 });
53 });
54}
16function download(url: string, filename: string) {
17 console.log(`download ${url}...`)
18 return new Promise<void>((resolve) => {
19 request(url, resolve).pipe(fs.createWriteStream(filename))
20 });
21}
166download() {
167 const files = osFilterObj(this.src() || []);
168 const urls = [];
169
170 if (files.length === 0) {
171 return Promise.reject(new Error('No binary found matching your system. It\'s probably not supported.'));
172 }
173
174 files.forEach(file => urls.push(file.url));
175
176 return Promise.all(urls.map(url => download(url, this.dest(), {
177 extract: true,
178 strip: this.options.strip
179 }))).then(result => {
180 const resultingFiles = flatten(result.map((item, index) => {
181 if (Array.isArray(item)) {
182 return item.map(file => file.path);
183 }
184
185 const parsedUrl = url.parse(files[index].url);
186 const parsedPath = path.parse(parsedUrl.pathname);
187
188 return parsedPath.base;
189 }));
190
191 return Promise.all(resultingFiles.map(fileName => {
192 return chmodAsync(path.join(this.dest(), fileName), 0o755);
193 }));
194 });
195}
18function _binDownload() {
19 const data = require("./binDownload");
20
21 _binDownload = function () {
22 return data;
23 };
24
25 return data;
26}
20function download(url, dest, cb) {
21 applyProxy({ rejectUnauthorized: false }, function(options) {
22 var returnError = function(err) {
23 cb(typeof err.message === 'string' ? err.message : err);
24 };
25 request.get(url, options).on('response', function(response) {
26 if (response.statusCode < 200 || response.statusCode >= 300) {
27 returnError('Can not download file from ' + url);
28 return;
29 }
30 response.pipe(fs.createWriteStream(dest));
31 }).on('error', returnError);
32 });
33}
6function download(callback) {
7 if (fs.existsSync(binaryPath)) {
8 return process.nextTick(callback);
9 }
10
11 moz.download(
12 'firefox',
13 binaryPath,
14 function(err, path) {
15 if (err) throw err;
16 callback();
17 }
18 );
19}
83function js_min() {
84
85 var filename = "angular-super-gallery.js";
86 var header = require('gulp-header');
87 var package = require('./package.json');
88
89 return src([
90 DIST + "/" + filename,
91 ])
92 .pipe(concat(filename))
93 .pipe(rename({ suffix: '.min' }))
94 .pipe(uglify())
95 .pipe(header(banner, { pkg: package }))
96 .pipe(dest(DIST))
97 .pipe(gzip({ append: true }))
98 .pipe(dest(DIST));
99
100}
19return function minJs(cb) {
20 if (distData.currentConfig.minJs)
21 return gulp.src(distData.currentConfig.buildPaths.tmp.dir + '/**/*.js')
22 .pipe(uglify())
23 .pipe(gulp.dest(distData.currentConfig.buildPaths.tmp.dir));
24 else cb();
25}
53function min( folder, filename, ext )
54{
55 ext = ext || '.js';
56
57 browserify( './src/' + folder + '/' + filename + ext )
58 .transform( babelify )
59 .bundle()
60 .pipe( fs.createWriteStream( __dirname + '/dist/' + filename + '.min' + ext ) )
61 .on( 'finish', function()
62 {
63 gulp.src( './dist/' + filename + '.min' + ext )
64 .pipe( uglify() )
65 .pipe( header( licenceShort ) )
66 .pipe( gulp.dest( './dist/' ) )
67 } );
68}

Related snippets