@bb-cli/portal-model : object
Load And Manipulate Model Xml DataExample
import { fromXml, name }from '@bb-cli/portal-model';
console.log(`name is ${name(fromXml(fs.readFileSync('model.xml')))}`);
- @bb-cli/portal-model :
object
* [~type(model)](#module_@bb-cli/portal-model..type) ⇒ <code>string</code>
* [~fromXml(xml)](#module_@bb-cli/portal-model..fromXml) ⇒ <code>object</code>
* [~toXml(model)](#module_@bb-cli/portal-model..toXml) ⇒ <code>string</code>
* [~name(model)](#module_@bb-cli/portal-model..name) ⇒ <code>string</code>
* [~getPropertyValue(name, model)](#module_@bb-cli/portal-model..getPropertyValue) ⇒ <code>string</code>
* [~setProperty(propertyName, value, options, model)](#module_@bb-cli/portal-model..setProperty) ⇒ <code>object</code>
* [~deleteProperty(propertyName, model)](#module_@bb-cli/portal-model..deleteProperty) ⇒ <code>object</code>
@bb-cli/portal-model~type(model) ⇒ string
Extract catalog type from XML object.Kind: inner method of
@bb-cli/portal-model
| Param | Type | | --- | --- | | model |
object
| @bb-cli/portal-model~fromXml(xml) ⇒ object
Convert XML string to JS representation (using jxon).Kind: inner method of
@bb-cli/portal-model
| Param | Type | Description | | --- | --- | --- | | xml |
string
| Model xml |@bb-cli/portal-model~toXml(model) ⇒ string
Convert js object to XMLKind: inner method of
@bb-cli/portal-model
Returns:
string
- model XML| Param | Type | Description | | --- | --- | --- | | model |
object
| XML object |@bb-cli/portal-model~name(model) ⇒ string
Extract name from XML object.Kind: inner method of
@bb-cli/portal-model
| Param | Type | | --- | --- | | model |
object
| @bb-cli/portal-model~getPropertyValue(name, model) ⇒ string
Get the value of a property.Kind: inner method of
@bb-cli/portal-model
| Param | Type | | --- | --- | | name |
string
|
| model | object
| @bb-cli/portal-model~setProperty(propertyName, value, options, model) ⇒ object
Set the value & options of a property.Kind: inner method of
@bb-cli/portal-model
Returns:
object
- Updated model| Param | Type | | --- | --- | | propertyName |
string
|
| value | string
|
| options | object
|
| model | object
| @bb-cli/portal-model~deleteProperty(propertyName, model) ⇒ object
Delete a property.Kind: inner method of
@bb-cli/portal-model
Returns:
object
- Updated model| Param | Type | | --- | --- | | propertyName |
string
|
| model | object
|