Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nodeca/js-yaml-js-types
Extra js types for js-yaml
https://github.com/nodeca/js-yaml-js-types
Last synced: about 1 month ago
JSON representation
Extra js types for js-yaml
- Host: GitHub
- URL: https://github.com/nodeca/js-yaml-js-types
- Owner: nodeca
- License: mit
- Created: 2020-12-02T05:48:04.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-21T15:57:42.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T05:33:02.736Z (5 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 7
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
js-yaml-js-types
================[![CI](https://github.com/nodeca/js-yaml-js-types/workflows/CI/badge.svg?branch=master)](https://github.com/nodeca/js-yaml-js-types/actions)
[![NPM version](https://img.shields.io/npm/v/js-yaml-js-types.svg)](https://www.npmjs.org/package/js-yaml-js-types)> js-yaml extra types:
>
> - !!js/regexp /pattern/gim
> - !!js/undefined ''
> - !!js/function 'function () {...}'Installation
------------```sh
npm install js-yaml-js-types
```Usage
-----```js
const yaml = require('js-yaml');
const unsafe = require('js-yaml-js-types').all;const schema = yaml.DEFAULT_SCHEMA.extend(unsafe);
const src = `
- !!js/regexp /pattern/gim
- !!js/undefined ''
- !!js/function 'function () { return true }'
`yaml.load(src, { schema });
```