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

bleskomat.conf

v1.3.0

Published

Node.js module to read/write bleskomat.conf files. Also includes recommended fiat currency configurations.

Downloads

23

Readme

bleskomat.conf

Build Status

Node.js module to read/write bleskomat.conf files and parse/stringify bleskomat.conf key-value objects/strings. Also includes recommended fiat currency configurations.

Installation

Add to your application via npm:

npm install bleskomat.conf

Usage

Parse bleskomat.conf string:

const { parse } = require('bleskomat.conf');
console.log(parse('apiKey.id=b26c166655\napiKey.key=07d263ffbd33598a433ada729c883e1a54d566e8776dd4cdeaeadc5679781781\napiKey.encoding=hex\nshorten=1'));

Result:

{
	'apiKey.id': 'b26c166655',
	'apiKey.key': '07d263ffbd33598a433ada729c883e1a54d566e8776dd4cdeaeadc5679781781',
	'apiKey.encoding': 'hex',
	'shorten': true,
}

Stringify object as bleskomat.conf string:

const { stringify } = require('bleskomat.conf');
console.log(stringify({
	'apiKey.id': 'b26c166655',
	'apiKey.key': '07d263ffbd33598a433ada729c883e1a54d566e8776dd4cdeaeadc5679781781',
	'apiKey.encoding': 'hex',
	'shorten': true,
}));

Result:

apiKey.id=b26c166655
apiKey.key=07d263ffbd33598a433ada729c883e1a54d566e8776dd4cdeaeadc5679781781
apiKey.encoding=hex
shorten=1

Read bleskomat.conf file:

const { readFile } = require('bleskomat.conf');
readFile('./bleskomat.conf').then(result => {
	// `result` will be an object same as the `parse()` method.
	console.log(result);
}).catch(error => {
	console.error(error);
});

Write object to bleskomat.conf file:

const { writeFile } = require('bleskomat.conf');
writeFile('./bleskomat.conf', {
	'apiKey.id': 'b26c166655',
	'apiKey.key': '07d263ffbd33598a433ada729c883e1a54d566e8776dd4cdeaeadc5679781781',
	'apiKey.encoding': 'hex',
	'shorten': true,
}).then(result => {
	// `result` will be TRUE if file was written.
	console.log(result);
}).catch(error => {
	console.error(error);
});

Get array of fiat currency configurations:

const { fiatCurrencies } = require('bleskomat.conf');
console.log(fiatCurrencies);

Result:

[
	// ..
	{
		"fiatCurrency": "CZK",
		"coinValues": [1, 2, 5, 10, 20, 50],
		"coinValueIncrement": 1,
		"billValues": [100, 200, 500, 1000, 2000],
		"fiatPrecision": 0,
		"buyLimit": 20000
	},
	{
		"fiatCurrency": "EUR",
		"coinValues": [0.05, 0.10, 0.20, 0.50, 1.00, 2.00],
		"coinValueIncrement": 0.05,
		"billValues": [5, 10, 20, 50, 100, 200],
		"fiatPrecision": 2,
		"buyLimit": 1000
	}
	// ..
]

Tests

Run automated tests as follows:

npm test

Changelog

See CHANGELOG.md

License

This software is MIT licensed:

A short, permissive software license. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. There are many variations of this license in use.