Not Preposterously Macho

    maskedemail
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.0 • Public • Published

    FastMail maskedemail JS SDK

    JavaScript wrapper / SDK for interacting with FastMail's MaskedEmail service

    This is based off my maskedemail-cli

    Install

    yarn add maskedemail
    
    -- or -- 
    
    node i maskedemail
    

    Notes before using

    Instead of implementing the API in JavaScript, this package compiles maskedemail-cli to WASM, then executes that. The WASM is pretty unoptimized and rocks a whopping 7MB+ in file size :D

    Why?? Because I wanted to play around with WASM, and didn't want to duplicate the code again.

    There is a gopherjs fallback if WebAssembly is not available. Both gopherjs and wasm builds are pretty chunky in file size so probably not a good idea to use this on the browser.

    Usage

    Follow the "authentication" steps over at https://github.com/dvcrn/maskedemail-cli#authentication

    import { list, create } from "maskedemail";
    
    const token = "fastmailToken";
    const accID = "fastmailAccID";
    
    (async () => {
      const pr = await list(token, accID);
      console.log(pr);
    
      console.log("creating new");
    
      const created = await create(token, accID, "test.com");
      console.log(created);
    })().catch((err) => {
      console.error(err);
    });

    Using gopherjs mode instead

    import { init, list, create } from "maskedemail";
    
    const token = "fastmailToken";
    const accID = "fastmailAccID";
    
    (async () => {
      await init('gopherjs');
      const sess = await session(token);
      console.log(sess);
    })().catch((err) => {
      console.error(err);
    });

    Building

    Run make build to build the WASM file and run rollup to compile the TypeScript

    Gopherjs variant code is generated with make generate-gopherjs

    License

    MIT

    Keywords

    none

    Install

    npm i maskedemail

    DownloadsWeekly Downloads

    0

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    30.9 MB

    Total Files

    26

    Last publish

    Collaborators

    • dvcrn