# @bb-cli/portal-model

> Load And Manipulate Model Xml Data

Latest version **2.2.0** (published 2019-06-17) · SEE LICENSE IN LICENSE license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @bb-cli/portal-model
pnpm add @bb-cli/portal-model
yarn add @bb-cli/portal-model
bun add @bb-cli/portal-model
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2019-06-17 |
| First published | 2016-10-06 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 51.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bb-cli |
| Keywords | bb-cli-lib |

## Links

- npm: https://www.npmjs.com/package/@bb-cli/portal-model
- npm.io page: https://npm.io/package/@bb-cli/portal-model

## Dependencies (4)

- [jxon](https://npm.io/package/jxon.md) ^2.0.0-beta.3
- [formattor](https://npm.io/package/formattor.md) 0.0.2
- [lodash.clone](https://npm.io/package/lodash.clone.md) ^4.5.0
- [lodash.startcase](https://npm.io/package/lodash.startcase.md) ^4.4.0

## Recent versions

- 2.2.0 (latest) — 2019-06-17
- 2.1.1 — 2017-09-21
- 2.1.0 — 2017-06-07
- 2.0.5 — 2017-04-28
- 2.0.4 — 2016-11-17
- 2.0.3 — 2016-10-11
- 2.0.2 — 2016-10-06

## README

<a name="module_@bb-cli/portal-model"></a>

## @bb-cli/portal-model : <code>object</code>
Load And Manipulate Model Xml Data

**Example**  
``` javascript
import { fromXml, name }from '@bb-cli/portal-model';
console.log(`name is ${name(fromXml(fs.readFileSync('model.xml')))}`);
```

* [@bb-cli/portal-model](#module_@bb-cli/portal-model) : <code>object</code>
    * [~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>

<a name="module_@bb-cli/portal-model..type"></a>

### @bb-cli/portal-model~type(model) ⇒ <code>string</code>
Extract catalog type from XML object.

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  

| Param | Type |
| --- | --- |
| model | <code>object</code> | 

<a name="module_@bb-cli/portal-model..fromXml"></a>

### @bb-cli/portal-model~fromXml(xml) ⇒ <code>object</code>
Convert XML string to JS representation (using jxon).

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  

| Param | Type | Description |
| --- | --- | --- |
| xml | <code>string</code> | Model xml |

<a name="module_@bb-cli/portal-model..toXml"></a>

### @bb-cli/portal-model~toXml(model) ⇒ <code>string</code>
Convert js object to XML

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  
**Returns**: <code>string</code> - model XML  

| Param | Type | Description |
| --- | --- | --- |
| model | <code>object</code> | XML object |

<a name="module_@bb-cli/portal-model..name"></a>

### @bb-cli/portal-model~name(model) ⇒ <code>string</code>
Extract name from XML object.

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  

| Param | Type |
| --- | --- |
| model | <code>object</code> | 

<a name="module_@bb-cli/portal-model..getPropertyValue"></a>

### @bb-cli/portal-model~getPropertyValue(name, model) ⇒ <code>string</code>
Get the value of a property.

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  

| Param | Type |
| --- | --- |
| name | <code>string</code> | 
| model | <code>object</code> | 

<a name="module_@bb-cli/portal-model..setProperty"></a>

### @bb-cli/portal-model~setProperty(propertyName, value, options, model) ⇒ <code>object</code>
Set the value & options of a property.

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  
**Returns**: <code>object</code> - Updated model  

| Param | Type |
| --- | --- |
| propertyName | <code>string</code> | 
| value | <code>string</code> | 
| options | <code>object</code> | 
| model | <code>object</code> | 

<a name="module_@bb-cli/portal-model..deleteProperty"></a>

### @bb-cli/portal-model~deleteProperty(propertyName, model) ⇒ <code>object</code>
Delete a property.

**Kind**: inner method of <code>[@bb-cli/portal-model](#module_@bb-cli/portal-model)</code>  
**Returns**: <code>object</code> - Updated model  

| Param | Type |
| --- | --- |
| propertyName | <code>string</code> | 
| model | <code>object</code> |

---
_Source: https://npm.io/package/@bb-cli/portal-model · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
