diff --git a/src/encoding/armor.js b/src/encoding/armor.js index 78241b2b..8661c5c0 100644 --- a/src/encoding/armor.js +++ b/src/encoding/armor.js @@ -24,9 +24,9 @@ 'use strict'; -var base64 = require('./base64.js'), - enums = require('../enums.js'), - config = require('../config'); +import base64 from './base64.js'; +import enums from '../enums.js'; +import config from '../config'; /** * Finds out which Ascii Armoring type is used. Throws error if unknown type. diff --git a/src/hkp/hkp.js b/src/hkp/hkp.js index 01063ec7..dcfbe117 100644 --- a/src/hkp/hkp.js +++ b/src/hkp/hkp.js @@ -22,9 +22,8 @@ * in order to lookup and upload keys on standard public key servers. * @module hkp/hkp */ -module.exports = HKP; -var config = require('../config'); +import config from '../config'; /** * Initialize the HKP client and configure it with the key server url and fetch function. @@ -32,7 +31,7 @@ var config = require('../config'); * @param {String} keyServerBaseUrl (optional) The HKP key server base url including * the protocol to use e.g. https://pgp.mit.edu */ -function HKP(keyServerBaseUrl) { +export default function HKP(keyServerBaseUrl) { this._baseUrl = keyServerBaseUrl ? keyServerBaseUrl : config.keyserver; this._fetch = typeof window !== 'undefined' ? window.fetch : require('node-fetch'); }