9 examples of 'nodejs push' in JavaScript

Every line of 'nodejs push' 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
82registerPush(): Promise {
83 return;
84}
160function push(appId, envValue, cb) {
161 common.pushAppEnv(appId, envValue, function(err, data) {
162 return cb(err, data);
163 });
164}
143function git_push( branch, callback ){
144 console.log(branch);
145 git.push('origin', branch, function (err) {
146 if (err){
147 console.error( (err.message).red );
148 return callback(err);
149 }
150 else{
151 return callback(null);
152 }
153 });
154}
1module.exports = function push (remote) {
2 return `git push ${remote || 'heroku'} master`
3}
37function gitPush(callback) {
38 child.exec('git push -fu origin master', function(error, stdout, stderr) {
39 if (!error && stderr) process.stderr.write(stderr)
40 if (!error && stdout) process.stdout.write(stdout)
41 callback(error)
42 })
43}
35export function registerForPush(api: Api): Promise {
36 return new Promise(async (resolve, reject) => {
37 /**
38 * First we ask YT for token and exit if YT does not support PUSH notifications
39 */
40 let ytToken: string;
41 try {
42 log.debug(`Getting YT notifications token...`);
43 ytToken = await api.getNotificationsToken();
44 log.debug(`YT notifications token received: "${ytToken}"`);
45 } catch (err) {
46 if ([400, 404, 405].includes(err?.status)) {
47 log.debug('YouTrack server does not support push', err);
48 return reject(new Error('YouTrack does not support push notifications'));
49 }
50 throw err;
51 }
52
53 /**
54 * Then we register for push notifications with this token
55 */
56 async function onRegister(deviceToken): Promise {
57 NotificationsIOS.removeEventListener('remoteNotificationsRegistered', onRegister);
58 try {
59 const url = `${KONNECTOR_URL}/ring/pushNotifications`;
60 await api.makeAuthorizedRequest(url, 'POST', {token: ytToken, appleDeviceId: deviceToken});
61 resolve();
62 } catch (err) {
63 reject(err);
64 }
65 }
66 NotificationsIOS.addEventListener('remoteNotificationsRegistered', onRegister);
67
68 async function onRegistrationError(e) {
69 NotificationsIOS.removeEventListener('remoteNotificationsRegistrationFailed', onRegistrationError);
70 log.info('PUSH: registration error', e);
71 reject(e);
72 }
73 NotificationsIOS.addEventListener('remoteNotificationsRegistrationFailed', onRegistrationError);
74
75 // $FlowFixMe: error in type annotations of library
76 NotificationsIOS.requestPermissions();
77 });
78}
28pushCallback(callback) {
29 let name = `${Date.now()}#${Math.floor(Math.random() * 1000)}`;
30 this.callbacks[name] = callback;
31 return name;
32}
459push: function push(url){
460 var bundle = pathToBundle(url, routes);
461 if (navigator) {
462 console.log(bundle);
463 navigator.push({
464 'url': bundle,
465 'animated': 'true'
466 }, function () {
467 console.log('skip complete');
468 });
469 }
470},
146function dockerPush( packageConfig ) {
147
148 const proc = `docker`
149 const args = [
150 `push`,
151 `${createImageName( packageConfig )}`
152 ]
153
154 return execCommand( proc, args )
155
156}

Related snippets