Socket
Socket
Sign inDemoInstall

sodium-universal

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sodium-universal - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

internal/ed25519.js

24

build-scripts/generate.js

@@ -5,15 +5,23 @@ #!/usr/bin/env node

const path = require('path')
const dir = path.dirname(require.resolve('sodium-javascript/package.json'))
const root = path.dirname(require.resolve('sodium-javascript/package.json'))
const ls = fs.readdirSync(dir)
const tmp = `module.exports = require('sodium-native')\n`
const tmp = "module.exports = require('sodium-native')\n"
for (const file of ls) {
if (!/\.js$/i.test(file)) continue
if (file === 'example.js') continue
if (file === 'test.js') continue
function recurse (dir) {
const ls = fs.readdirSync(dir)
const subdir = path.relative(root, dir)
if (subdir) fs.mkdirSync(subdir, { recursive: true })
fs.writeFileSync(path.join(__dirname, '..', file), tmp.replace('{file}', file))
for (const file of ls) {
if (file === 'internal') recurse(path.join(dir, file))
if (!/\.js$/i.test(file)) continue
if (file === 'example.js') continue
if (file === 'test.js') continue
fs.writeFileSync(path.join(__dirname, '..', subdir, file), tmp)
}
}
recurse(root)
const pkg = require('sodium-javascript/package.json')

@@ -20,0 +28,0 @@ const myPkg = require('../package.json')

@@ -8,3 +8,3 @@ var exec = require('child_process').execSync

symbols = symbols.map(l => l.split(' ').pop().replace(/^\_/, '').replace(/(\_[^_]*bytes.*)/, (s) => s.toUpperCase()))
symbols = symbols.map(l => l.split(' ').pop().replace(/^_/, '').replace(/_[^_]*bytes.*/, (s) => s.toUpperCase()))

@@ -11,0 +11,0 @@ var missing = []

@@ -7,4 +7,4 @@ const fs = require('fs')

module.exports = function (file, opts) {
const basedir = path.dirname(file)
const name = path.basename(file)
const basedir = path.resolve(__dirname, '..')
const relname = path.relative(basedir, file)

@@ -20,3 +20,3 @@ if (opts._flags.browserField === false) {

flush (cb) {
const m = 'sodium-javascript/' + name
const m = 'sodium-javascript/' + relname
resolve(m, { basedir }, (err, file) => {

@@ -23,0 +23,0 @@ if (err) return cb(err)

{
"name": "sodium-universal",
"version": "3.0.0",
"version": "3.0.1",
"description": "Universal wrapper for sodium-javascript and sodium-native working in Node.js and the Browser",

@@ -8,7 +8,7 @@ "main": "index.js",

"resolve": "^1.17.0",
"sodium-javascript": "~0.6.0",
"sodium-native": "^3.2.0",
"sodium-javascript": "~0.6.1",
"blake2b": "^2.1.1",
"chacha20-universal": "^1.0.4",
"nanoassert": "^1.0.0",
"nanoassert": "^2.0.0",
"sha256-wasm": "^1.3.0",

@@ -15,0 +15,0 @@ "sha512-wasm": "^1.2.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc