npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@buttercup/app-env

v0.5.0

Published

Buttercup application environment configuration manager

Downloads

15

Readme

App Env

Buttercup application environment configuration manager

Build Status

About

Buttercup is a cross-platform password manager, and in being so requires vastly different configurations for each platform it runs on. Take for instance Buttercup for Desktop and the browser extension - one is Node (native) and the other is web-based. This project provides a method to set environment-specific tools and methods (for crypto, for instance). It also provides some presets for native and web.

React Native

There is no preset configuration in this library for React Native (Buttercup for Mobile), as this environment is extremely complex and highly-reliant on React-Native internals.

Usage

Step 1: Install @buttercup/app-env as a dependency:

npm install @buttercup/app-env --save

Step 2: Load a preset environment:

// For node:
require("@buttercup/app-env/native");
// For web:
import "@buttercup/app-env/web";

Or execute a custom environment configuration (see later section).

Step 3: Load Buttercup and other dependencies

Buttercup should always be loaded after the app-env:

const { ArchiveManager } = require("buttercup");

// ...

Custom environment configuration

You can easily specify your own configuration by specifying methods for each required property, for example:

const { getSharedAppEnv } = require("@buttercup/app-env");

function decryptText(/* ... */) {
    /* ... */
}

function encryptText(/* ... */) {
    /* ... */
}

getSharedAppEnv().setProperties({
    "crypto/v1/decryptText": decryptText,
    "crypto/v1/encryptText": encryptText
});

The following properties should be specified:

| Property | Description | |-------------------------------|-------------------------------------------| | compression/v1/compressText | Method for compressing text -> text. | | compression/v1/decompressText | Method for decompressing text -> text. | | crypto/v1/decryptText | Decryption method for decrypting text. | | crypto/v1/encryptText | Encryption method for encrypting text. | | crypto/v1/setDerivationRounds | Set the number of derivation rounds to use for key derivation. |