1.0.0 • Published 8 years ago

connman-config v1.0.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

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

ParamTypeDescription
objectObjectconfiguration 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

ParamTypeDescription
stringStringconfiguration 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.

1.0.0

8 years ago