How to use the js-base64.Base64 function in js-base64

To help you get started, we’ve selected a few js-base64 examples, based on popular ways it is used in public projects.

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

github dpa99c / cordova-check-plugins / lib / remote.js View on Github external
var exec = require('child_process').exec;

    // lib
    var logger = require('./logger.js')();
    var errorHandler = require('./errorHandler.js')();
    var progress = require('./progress.js')();
    var cliArgs = require('./cliArgs.js')().args;

    // 3rd party
    try{
        var fs = require('fs-extra');
        var xml2js = require('xml2js').parseString;
        var _ = require('lodash');
        var semver = require('semver');
        var github = require('octonode');
        var Base64 = require('js-base64').Base64;
    }catch(e){
        errorHandler.handleFatalException(e, "Failed to acquire module dependencies");
    }

    /**********************
     * Internal properties
     *********************/
    var remote = {};

    var opts, plugins, onFinish, pluginCount, unconstrainVersions,
        checkCount, ghClient;

    /**********************
     * Internal functions
     *********************/
github fluidtrends / chunky / cloud / src / firebase.js View on Github external
const firebase = require('firebase-admin')
const firebaseline = require('firebaseline')
const Base64 = require('js-base64').Base64

function operation (name, args) {
  return firebaseline.operations[name](firebase, args)
}

function initialize (config) {
  if (firebase.apps.length > 0) {
    // No need to inititalize again
    return
  }

  // Initialize for the first time
  firebase.initializeApp({
    credential: firebase.credential.cert(config.serviceAccount),
    databaseURL: 'https://' + config.serviceAccount.project_id + '.firebaseio.com'
  })
github chriseth / browser-solidity / src / app.js View on Github external
/* global alert, confirm, prompt, FileReader, Option, Worker, chrome */
'use strict'

var $ = require('jquery')
var base64 = require('js-base64').Base64
var swarmgw = require('swarmgw')

var QueryParams = require('./app/query-params')
var queryParams = new QueryParams()
var GistHandler = require('./app/gist-handler')
var gistHandler = new GistHandler()

var Storage = require('./app/storage')
var Files = require('./app/files')
var Config = require('./app/config')
var Editor = require('./app/editor')
var Renderer = require('./app/renderer')
var Compiler = require('./app/compiler')
var ExecutionContext = require('./app/execution-context')
var UniversalDApp = require('./universal-dapp.js')
var Debugger = require('./app/debugger')
github microsoft / pai / src / rest-server / src / models / template.js View on Github external
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


const base64 = require('js-base64').Base64;
const github = require('@octokit/rest');
const https = require('https');
const url = require('url');
const yaml = require('js-yaml');

const logger = require('../config/logger');
const config = require('../config/github');

const contentUrlPrefix = `https://raw.githubusercontent.com/${config.owner}/${config.repository}`;

/**
 * Get template content by the given qualifier.
 * @param {*} options A MAP object containing keys 'type', 'name', 'version'.
 * @param {*} callback A function object accepting 2 parameters which are error and result.
 */
const load = (options, callback) => {
github fluidtrends / chunky / cli / executors / carmel / actions / next / index.js View on Github external
const path = require('path')
const fs = require('fs-extra')
const coreutils = require('coreutils')
const hook = require('hook-std')
const status = require('../../status')
const operation = require('../../operation')
const utils = require('../../utils')
const chalk = require('chalk')
const env = require('../../validate/env')
const opn = require('opn')
const marked = require('marked')
const Base64 = require('js-base64').Base64

const TerminalRenderer = require('marked-terminal')
const Handlebars = require('handlebars')
const Mocha = require('mocha')
const CaptureStdout = require('capture-stdout')

const challenge = require('./challenge')
const begin = require('./begin')

marked.setOptions({
  renderer: new TerminalRenderer()
})

function initArgs (challenge, cache, original) {
  return Object.assign({}, { utils: env(cache), challenge }, original && { original })
}
github QardsJs / qards / plugins / qards-netlify-cms-paths / gatsby-node.js View on Github external
require('typescript-require');

const _ = require('lodash');
const base64 = require('js-base64').Base64;
const path = require('path');
const makeRelative = require('./make-relative');
const deepMap = require('deep-map-object');

const mapNetlifyMediaPath = (node, options) => {
	if (node.internal.type === `MarkdownRemark`) {
		node.frontmatter = deepMap(value => {
			const {default: netlifyCfg} = require(options.cmsConfigPath);
			return makeRelative(node.fileAbsolutePath, value, netlifyCfg);
		})(node.frontmatter);

		node.fields = deepMap(value => {
			const {default: netlifyCfg} = require(options.cmsConfigPath);
			return makeRelative(node.fileAbsolutePath, value, netlifyCfg);
		})(node.fields);
	}
github WeBankPartners / open-monitor / monitor-ui / src / views / register.vue View on Github external
this.$refs['loginForm'].validate((valid) => {
        if (valid) {
          let Base64 = require('js-base64').Base64
          this.form.password = Base64.encode(this.form.password)
          this.form.re_password = Base64.encode(this.form.re_password)
          axios({
            method: 'POST',
            url: url,
            data: {
              ...this.form
            }
          }).then((response) => {
            if (response.status < 400) {
              setToken(`${response.data.data.token}`)
              localStorage.username = response.data.data.user
              this.$Message.success(response.data.message)
              this.$router.push({path: '/'})
            }
          })
github gbif / portal16 / app / controllers / auth / local / local.ctrl.js View on Github external
'use strict';
let express = require('express'),
    router = express.Router(),
    passport = require('passport'),
    BasicStrategy = require('passport-http').BasicStrategy,
    User = require('../../api/user/user.model'),
    Base64 = require('js-base64').Base64,
    auth = require('../auth.service');

module.exports = function(app) {
    app.use('/api/auth', router);
};

router.get('/basic', function(req, res, next) {
    auth.setNoCache(res);
    passport.authenticate('basic', {session: false}, function(err, user, info) {
        let error = err || info;
        if (error) {
            return res.status(401).json({message: 'Unable to verify.'});
        }
        if (!user) {
            return res.status(404).json({message: 'Something went wrong, please try again.'});
        }