Socket
Book a DemoInstallSign in
Socket

quietjs-bundle-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quietjs-bundle-cli

A utility to bundle quiet-js in one file

Source
npmnpm
Version
0.0.8
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

quietjs-bundle

GitHub license David

quietjs-bundle is a ready-to-use bundled version of quiet-js that you can require in CommonJS/TypeScript-based web projects

const quiet = require('quietjs-bundle');

quiet.addReadyCallback(() => {
   quiet.receiver({ profile: 'ultrasonic-experimental', onReceive: console.log });
});

Motivations

I needed to use quiet-js in a project, and was annoyed by the fact that I needed to serve many dependencies for the library to work and couldn't bundle everything in one file with a tool like ParcelJS. I made this bundler, which automatically downloads all the required files from the latest version of quiet-js from its GitHub repository and combines the files together.

Features

  • Bundles quiet-emscripten.js.mem (a binary file) using base64
  • Initializes the library as soon as the bundle is loaded on the webpage
  • Allows the whole code to be wrapped in an IIFE, so the global scope isn't polluted
  • Includes TypeScript definitions

Installation

npm i quietjs-bundle

Installing the module will build the bundle a first time. If you want to rebuild it, navigate to node_modules/quietjs-bundle in your shell and run npm run-script bundle.

TODO

  • More size-efficient quiet-emscripten.js.mem bundling (currently stored as a string literal using base64)
  • Download specific quiet-js commit instead of latest for stability
  • Document the TypeScript definitions

License

This project itself is licensed under the MIT license. However, this tool bundles code from different sources that each have their own license. You are entirely responsible for every bit of licensed code that can end up in the final script.

Since the whole downloading & building/bundling process involving externally licensed code happens on your computer, I don't think that I have to specify the license of each piece of code. After all, this project is just a tool that does all the magic™. However, I'm not a lawyer, and if the previous statement is wrong, get in touch with me so I fix this !

Keywords

bundle

FAQs

Package last updated on 26 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts