https://github.com/nodeca/js-yaml-js-types
Extra js types for js-yaml
https://github.com/nodeca/js-yaml-js-types
Last synced: 3 months 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-21T15:57:42.000Z (over 2 years ago)
- Last Synced: 2025-04-12T02:38:44.981Z (3 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 9
- Watchers: 5
- Forks: 4
- 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
================[](https://github.com/nodeca/js-yaml-js-types/actions)
[](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 });
```