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

eddystone-beacon-config

v0.1.3

Published

Eddystone beacon configuration service for Node.js

Downloads

9

Readme

eddystone-beacon-config

Eddystone beacon configuration service for Node.js. The configuration service allows you can build up Eddystone configuration service easily on Node.js with bleno. This configuration service has passed the validation test of Eddystone url config validator

WARNING

  • It rather a bit experimental project to me. I'll keep working for a while so the project content might be changed a lot suddenly.
  • The package has been tested on MacOS only

Install

$ npm install --save eddystone-beacon-config

Usage

var defaults = {
	name: 'Eddystone-URL Configuration Service',
	uri: 'http://google.com',
	flags: 0, // set uri flags to 0
	txPowerMode: TX_POWER_MODE_LOW,
	txPowerLevel: TX_POWER_MODE_LEVELS,
	beaconPeriod: 1000 // beacon period to 1000 (1 second)
};

var beaconConfigService = require('eddystone-beacon-config');

// unlock if you want to accept to configure by new data
beaconConfigService.unlock();

// update event hander
beaconConfigService.on('update', function (e) {
	console.log('%s has been updated %s', e.name, e.value);

	// reset event handler, if you've got reset event with true
	if (e.name === 'reset' && e.value == 1) {
		console.log('have got reset request');
		configs = objectAssign(defaults);
		beaconConfigService.configure(configs);
	} else {
		configs[e.name] = e.value;
	}
});

// handling disable event
beaconConfigService.on('disable', function (e) {
	console.log('Have got zero-beacon-period to stop transmitting URL');
});

// start advertising
beaconConfigService.advertise(defaults, {
	beaconConfigService.advertise(configs, {
		periodLowest: BEACON_PERIOD_LOWEST
	});
});

API

advertise(configs, [options])

Start Eddystone configuration service advertising with configs and options

configs

Configurations for Eddystone configuration service. all of the properties come from Eddystone configuration service spec document. excepts name for advertising

var defaults = {
	name: 'Eddystone-URL Configuration Service',
	uri: 'http://google.com',
	flags: 0, // set uri flags to 0
	txPowerMode: TX_POWER_MODE_LOW,
	txPowerLevel: TX_POWER_MODE_LEVELS,
	beaconPeriod: 1000 // beacon period to 1000 (1 second)
};

unlock / lock

unlock allows beacon is able to during configuration mode. lock make beacon is not able to allow request for writing to update configs

configure(configs)

to update configs in configuration service

options

Options for running configuration service.

  • periodLowest: Lowest value for Beacon period. It wouldn't be updated if service gets the value lower than by the value.

Events

update

update event will being raised after receiving write request. the events come with two properties which are name and 'value'.

- name: the name of the event, It should be a name of configurations. So You can access a value of configs if you are going to use same name in configs with the name of the `event`
- value: the value of received

If the name of event is reset? the event is more special, which allows and forces you setting reset. the value should be 1. but URI is optional. see more information

disable

disable event will being raised if we've got A value of zero of period. It means that you disables Eddystone-URL transmissions. see more information

License

MIT © Jimmy Moon