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

@hal313/settings-manager

v1.1.2

Published

A package for abstracting settings repositories

Downloads

4

Readme

settings-manager

A facade for user settings repositories.

Build Status NPM version Dependency Status

Introduction

This is intended as a generic interface to an asynchronous setting API. Using this library allows for abstraction of the underlying settings. This package was inspired by Chrome plugin and Firebase development.

See an example.

Using

API

new SettingsManager([backing_store])

Creates a new SettingsManager instance. The optional backing store should implement the same API as SettingsManager, or have an adapter provided. With no backing store specified, an in-memory store will be used.

load([success[, error]])

Loads the settings. Takes a success callback and an error callback. The value passed into the settings callback represents the value from the backing store.

save(settings[, success[, error]])

Saves the settings. Requires the settings to save and takes an optional callback for the success or error status.

clear([success[, error]])

Clears the settings. Takes an optional callback for the success or error status.

Importing

Depending on your environment, you may incorporate the SettingsManager:

| Style | File | Import Statement | Instantiate | | ----- | ------------------------ | ------------------------------------------------------------ | -------------------------------------------------------------- | | ES5 | SettingsManager.js | <script src="SettingsManager.js"></script> | var settingsManager = new SettingsManager.SettingsManager(); | | CJS | SettingsManager.js | <script src="SettingsManager.js"></script> | var settingsManager = new SettingsManager.SettingsManager(); | | AMD | SettingsManager.js | <script src="SettingsManager.js"></script> | var settingsManager = new SettingsManager.SettingsManager(); | | ES6 | SettingsManager.es6.js | import { SettingsManager } from 'SettingsManager.js'; | let sm = new SettingsManager(); | | Node | N/A | let SettingsManager = require('@hal313/settings-manager'); | let sm = new SettingsManager.SettingsManager(); |

Examples

The GitHub Pages documentation illustrates several examples.

Developing

Setup

npm install

Building

A build will check the source code and place code in the dist directory.

npm run build

To run a build on source code changes:

npm run watch:build

To build distributable artifacts (which includes a minimized version):

npm run dist

Running Tests

To run tests against the source code and dist folder (including coverage):

npm test

To run tests against the source code and dist folder (including coverage), with reload:

npm run test:watch

Build a Release

This is a basic script which can be used to build and deploy (to NPM) the project.

npm run release

Releases to the NPM registry are handled by Travis CI. Pushing master to GitHub will trigger a build and deploy to the NPM registry. The release script will NOT push to the repository. When pushing, tags should be included:

git push --all && git push --tags