libwpkg

0.0.2 • Public • Published

libWPKG.js - JavaScript library

Small library for work with WPKG XML configuration files.

npm install --save libwpkg

Small how to

More examples here.

// Enable WPKG module
let wpkg = require("libwpkg");

Hosts

Example of Hosts XML file is here.

How to import and work with Hosts object:

// Import XML file
wpkg.hosts.import(__dirname + '/extra/hosts.xml');
 
// Get all hosts
let hosts_all = wpkg.hosts.get();
console.log(hosts_all);
 
// Get single host by hostname
let host_single = wpkg.hosts.get('host2');
console.log(host_single);

Profiles

Example of Profiles XML file is here.

How to import and work with Profiles object:

wpkg.profiles.import(__dirname + '/extra/profiles.xml');
 
let profiles_all = wpkg.profiles.get();
console.log(profiles_all);
 
let profile_single = wpkg.profiles.get('profile3');
console.log(profile_single);

Get Support!

Some links

Package Sidebar

Install

npm i libwpkg

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

10.3 kB

Total Files

11

Last publish

Collaborators

  • evilfreelancer