connman-config

1.0.0 • Public • Published

connman-config

Parse and stringify Connman configuration files

npm version dependencies Build Status Build status

Installation

Install connman-config by running:

$ npm install --save connman-config

Documentation

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

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.

Package Sidebar

Install

npm i connman-config

Weekly Downloads

1

Version

1.0.0

License

Apache-2.0

Last publish

Collaborators

  • jviotti