connman-config
v1.0.0
Published
Parse and stringify Connman configuration files
Downloads
2
Readme
connman-config
Parse and stringify Connman configuration files
Installation
Install connman-config
by running:
$ npm install --save connman-config
Documentation
- connman
- .stringify(object) ⇒ String
- .parse(string) ⇒ Object
connman.stringify(object) ⇒ String
Kind: static method of connman
Summary: Stringify a Comman configuration object
Returns: String - connman configuration string
Access: public
| Param | Type | Description | | --- | --- | --- | | object | Object | configuration object |
Example
var connman = require('connman-config');
connman.stringify({
service_home_ethernet: {
Type: 'ethernet',
Nameservers: [
'8.8.8.8',
'8.8.4.4'
]
},
service_home_wifi: {
Type: 'wifi',
Name: 'Resin'
}
});
[service_home_ethernet]
Type = ethernet
Nameservers = 8.8.8.8,8.8.4.4
connman.parse(string) ⇒ Object
Kind: static method of connman
Summary: Parse a Connman configuration string
Returns: Object - connman configuration object
Access: public
| Param | Type | Description | | --- | --- | --- | | string | String | configuration string |
Example
var connman = require('connman-config');
connman.parse([
'[service_home_ethernet]',
'Type = ethernet',
'Nameservers = 8.8.8.8,8.8.4.4'
].join('\n'));
{
service_home_ethernet: {
Type: 'ethernet',
Nameservers: [
'8.8.8.8',
'8.8.4.4'
]
},
service_home_wifi: {
Type: 'wifi',
Name: 'Resin'
}
}
Support
If you're having any problem, please raise an issue on GitHub and I'll be happy to help.
Tests
Run the test suite by doing:
$ npm test
Contribute
- Issue Tracker: github.com/resin-io-modules/connman-config/issues
- Source Code: github.com/resin-io-modules/connman-config
Before submitting a PR, please make sure that you include tests, and that jshint runs without any warning:
$ npm run-script lint
License
The project is licensed under the MIT license.