Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wmfs/cardscript-extract-defaults


https://github.com/wmfs/cardscript-extract-defaults

cardscript tymly

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# cardscript-extract-defaults

[![Tymly Cardscript](https://img.shields.io/badge/tymly-cardscript-blue.svg)](https://tymly.io/)
[![CircleCI](https://circleci.com/gh/wmfs/cardscript-extract-defaults.svg?style=svg)](https://circleci.com/gh/wmfs/cardscript-extract-defaults)
[![npm (scoped)](https://img.shields.io/npm/v/@wmfs/cardscript-extract-defaults.svg)](https://www.npmjs.com/package/@wmfs/cardscript-extract-defaults)
[![codecov](https://codecov.io/gh/wmfs/cardscript-extract-defaults/branch/master/graph/badge.svg)](https://codecov.io/gh/wmfs/cardscript-extract-defaults)
[![CodeFactor](https://www.codefactor.io/repository/github/wmfs/cardscript-extract-defaults/badge)](https://www.codefactor.io/repository/github/wmfs/cardscript-extract-defaults)
[![Dependabot badge](https://img.shields.io/badge/Dependabot-active-brightgreen.svg)](https://dependabot.com/)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmfs/tymly/blob/master/packages/concrete-paths/LICENSE)

> Extracts sensible defaults from some Cardscript.

## Install
```bash
$ npm install cardscript-extract-defaults --save
```

## Usage

```javascript
const extractDefaults = require('@wmfs/cardscript-extract-defaults')

const defaultValues = extractDefaults(
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Change me!",
"color": "attention",
"horizontalAlignment": "center"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
)

```

## Testing

```bash
$ npm test
```

## License
[MIT](https://github.com/wmfs/cardscript/blob/master/LICENSE)