This package has been deprecated

Author message:

resin-network-config is deprecated, please use balena-device-config instead

resin-network-config

1.0.0 • Public • Published

resin-network-config

npm version dependencies Build Status

Handle resin images network configuration.

Installation

Install resin-network-config by running:

$ npm install --save resin-network-config

Documentation

Object network.getFiles(Object options = {})

Get network related configuration files.

The function accepts an optional options object which can have the following properties:

  • options.wifiSsid, a string that represents the wifi ssid to connect to. If this property is not defined, only ethernet connection will be configured for the device.
  • options.wifiKey, a string that represents the wifi key to use with the defined wifi ssid. If this property is not defined, then the wifi connection will be configured without a passphrase.
networkConfig = require('resin-network-config')

files = networkConfig.getFiles
	wifiSsid: 'foobar'
	wifiKey: 'hello'

console.log(files)

{
	'network/settings': '''
		[global]
		OfflineMode=false

		[WiFi]
		Enable=true
		Tethering=false

		[Wired]
		Enable=true
		Tethering=false

		[Bluetooth]
		Enable=true
		Tethering=false
	''',
	'network/network.config': '''
		[service_home_ethernet]
		Type = ethernet
		Nameservers = 8.8.8.8,8.8.4.4

		[service_home_wifi]
		Type = wifi
		Name = foobar
		Passphrase = hello
		Nameservers = 8.8.8.8,8.8.4.4
	'''
}

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ gulp lint

Support

If you're having any problem, please raise an issue on GitHub.

License

The project is licensed under the MIT license.

Dependencies (1)

Dev Dependencies (8)

Package Sidebar

Install

npm i resin-network-config

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • balena.io