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

tangle-config

v0.1.1

Published

Configuration manager for tangle

Downloads

5

Readme

tangle-config

Configuration management for tangle

Strider Build Status Travis Build Status Dependency Status devDependency Status Gittip

NPM

Overview

tangle is a set of tools for building web applications.

tangle-config implements the config subcommand for tangle.

Usage

--key, -k [String] - A configuration key to operate on. If --value is not
                     set, the current value will be written to STDOUT. Keys
                     are namespaced and delimited by ':'.

--value, -v [String] - Save a new value to the specified key.

--file, -f [Path] - Explicitely specify the configFile to operate on. If
                    not set, $HOME/.tangle will be used.

--edit, -e - Manually edit configuration with $EDITOR

--help, -h - Display this message

Examples

# Set your Github username
$ tangle-config -k github:username -v 'yourname'

# Print the current Github username to STDOUT
$ tangle-config -k github:username

# Edit configuration using a text editor
$ tangle-config --edit

API

You can (and should!) use this interface to manage user configuration within your own tangle plugins.


config = require 'tangle-config'

# Reading the global defaults
config.defaults

# Getting the current config file path
config.configFile()

# Retrieving the nconf object
nconf = config.getConf()

# Getting a value
nconf.get 'namespace:key'

The nconf object returned using configFile() has already loaded the config file, env overrides, and the global defaults (in that order of precedence).

The default config file is ~/.tangle, which can be changed by setting the environment variable tangle_config=PATH

See nconf for further documentation.

Project Files

You can use project files to store non-global configuration in a file called tangle.json at the current directory.

config = require 'tangle-config'

# Get a `tangle.json` file in the current working directory
projectFile = config.projectFile()

# Retrieving the nconf object
project = config.getProject()

# Getting a value
project.get 'namespace:key'

# Setting a value
project.set 'namespace:key', value

# Saving the file
project.save (err) ->
  fs.readFile projectFile, (err, data) -> console.error err if err

Contributing

The test suite is implemented with nodeunit and nixt.

To rebuild & run the tests

$ mkdir tanglejs
$ cd tanglejs
$ git clone https://github.com/tanglejs/config.git
$ cd config
$ npm install
$ grunt test

You can use grunt watch to automatically rebuild and run the test suite when files are changed.

Use npm link from the project directory to tell tangle-config to use your modified tangle-config during development.

To contribute back, fork the repo and open a pull request with your changes.

License

Copyright (c) 2014 Logan Koester Licensed under the MIT license.