{"_id":"yaml-types","_rev":"3-6262554bf78ed7468aa0ce90e0b268dc","name":"yaml-types","description":"Useful JavaScript types for YAML","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"yaml-types","version":"0.1.0","keywords":["YAML","schema","tags"],"author":{"name":"Eemeli Aro","email":"eemeli@gmail.com"},"license":"ISC","_id":"yaml-types@0.1.0","maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"homepage":"https://eemeli.org/yaml/","bugs":{"url":"https://github.com/eemeli/yaml-types/issues"},"dist":{"shasum":"511a201a452034e073f0af081842a0b69fdecaba","tarball":"https://registry.npmjs.org/yaml-types/-/yaml-types-0.1.0.tgz","fileCount":7,"integrity":"sha512-LeiagbmBzuwRez0UVAahUYLGOY8UQE/VTyPYMvMncABeTzqhEHYGUCR9iC/rA7YgYa9yLceuUze3HToHlEL5lw==","signatures":[{"sig":"MEYCIQDVn5vDlJqYXOQLau69bhDbc6TK0Ux1xdhOOff2sAhx+gIhAOAteli0/H0+/HirmP8dJDdgah6WxUDn2FoX8qsKgGOI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOYRiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBBw//VJ36/LWlIit8FifGhswxb/qKxucO2ltebqR9DQ/7pPLnfOAw\r\no4/hZ2B56fDqQqP4reyvgkiTIRRus91vMqlYDVXoIj5Qb7pKaDGDwKrR+JLZ\r\nsyz90DQhaxeWcbGezFNlvsiRN69QxqeabTV3CBcXojsFIF1EjiGJONgaPDIa\r\ngVCukP/zmDbghENZxx9IHKd2d/kl5ZKEjPzvyrn0z6tUZK8acpGj1ZprdeiE\r\nAxelewDRrSy/OZRfii+yoJfm2BzIMIRU5uYlx7mdb8FI5J7MP5DlboxWJSvb\r\nlw8kxuRBVPNFqBxP3euL/qbi2XdYOaeDE+oqhpJYk/qJdPomXZ4v+L2MDrDC\r\nGIphCEhuyRD8KiMvcBKbk/CaaLrtSAvzLMMITz9qXPiACf5wdF/raPEOaaMc\r\nz1eg0R7QJYTDPXo/mbFzejM9eB62rA9de6pSb7Uku+OCUHElj7G0HxccbbYF\r\ntameILMl1i2u8j+r20gwlU7azd/aP/+2CaVRlsR7tXNgcPP4GvAA6urDxNWt\r\n0uH9vyIvF0Qm1HrKjgENw0XTmzTPpH8IKs96zXanMBmvcWlr1/IlsMhy31Qy\r\nO2EDLNK1Qhq8+ZgGreMd4pILuDqZmnLw7MnhoZ6cXcRGkrHr4hN47R1l6tg1\r\nyNX2sZUElWzht7EkJAvoEPHke/CcklgOAzA=\r\n=j5OH\r\n-----END PGP SIGNATURE-----\r\n"},"type":"commonjs","engines":{"npm":">= 7","node":">= 16"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"gitHead":"bc10eeb09493c1a3a455aa829503089fc896019a","scripts":{"test":"tap --test-regex '\\.test\\.js$'","build":"tsc","clean":"git clean -fdxe node_modules","start":"node -i -e 'YAML=require(\"yaml\");YT=require(\"./dist/index.js\")'","pretest":"tsc","prestart":"tsc","prettier":"prettier --write .","prepublishOnly":"npm run clean && npm run test"},"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"prettier":{"semi":false,"arrowParens":"avoid","singleQuote":true,"trailingComma":"none"},"repository":{"url":"git+https://github.com/eemeli/yaml-types.git","type":"git"},"_npmVersion":"9.5.1","description":"Useful JavaScript types for YAML","directories":{},"_nodeVersion":"19.8.1","_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.4","yaml":"^2.3.0-3","prettier":"^2.8.7","@types/tap":"^15.0.8","typescript":"^5.0.4"},"peerDependencies":{"yaml":"~2"},"_npmOperationalInternal":{"tmp":"tmp/yaml-types_0.1.0_1681491042267_0.8371245902955642","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"yaml-types","version":"0.2.0","keywords":["YAML","schema","tags"],"author":{"name":"Eemeli Aro","email":"eemeli@gmail.com"},"license":"ISC","_id":"yaml-types@0.2.0","maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"homepage":"https://eemeli.org/yaml/","bugs":{"url":"https://github.com/eemeli/yaml-types/issues"},"tap":{"test-regex":"\\.test\\.js"},"dist":{"shasum":"e1ef7558683615578b080556c5d3a04bd4b27b66","tarball":"https://registry.npmjs.org/yaml-types/-/yaml-types-0.2.0.tgz","fileCount":17,"integrity":"sha512-oVDXtG8Fetcnfvw3yb+1p7Q/SOvXI/9vz4WAVW4nz/0wIng5tYE8w1Yj+ECo36e8amZQfsiXLnObUpml8G3imQ==","signatures":[{"sig":"MEYCIQDzFVVYNYB5q0ETVM/T726WWGp7SN5rSEi9ZzjZD9TaKwIhAImkPgeP7aEJyP7OBMYjzN5faN+OdCl1zFPRFnG0oDVi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19786},"type":"commonjs","engines":{"npm":">= 7","node":">= 16"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"gitHead":"4031c9e7cfa5d5813dac9a54403697efb598ca2a","scripts":{"test":"tap","build":"tsc","clean":"git clean -fdxe node_modules","start":"node -i -e 'YAML=require(\"yaml\");YT=require(\"./dist/index.js\")'","pretest":"tsc","prestart":"tsc","prettier":"prettier --write .","prepublishOnly":"npm run clean && npm run test"},"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"prettier":{"semi":false,"arrowParens":"avoid","singleQuote":true,"trailingComma":"none"},"repository":{"url":"git+https://github.com/eemeli/yaml-types.git","type":"git"},"_npmVersion":"9.5.1","description":"Useful JavaScript types for YAML","directories":{},"_nodeVersion":"19.8.1","_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.4","yaml":"^2.3.0","prettier":"^2.8.7","@types/tap":"^15.0.8","typescript":"^5.0.4"},"peerDependencies":{"yaml":"^2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/yaml-types_0.2.0_1684842054890_0.6975895645165013","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"yaml-types","version":"0.3.0","keywords":["YAML","schema","tags"],"author":{"name":"Eemeli Aro","email":"eemeli@gmail.com"},"license":"ISC","_id":"yaml-types@0.3.0","maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"homepage":"https://eemeli.org/yaml/","bugs":{"url":"https://github.com/eemeli/yaml-types/issues"},"tap":{"test-regex":"\\.test\\.js"},"dist":{"shasum":"b077f34496e12dc709d97f2c3bad3fff11089680","tarball":"https://registry.npmjs.org/yaml-types/-/yaml-types-0.3.0.tgz","fileCount":19,"integrity":"sha512-i9RxAO/LZBiE0NJUy9pbN5jFz5EasYDImzRkj8Y81kkInTi1laia3P3K/wlMKzOxFQutZip8TejvQP/DwgbU7A==","signatures":[{"sig":"MEYCIQD/+SEV2LoQT4Cwfxz03eBegMA0skbOIEJZwK4VTk0EhgIhAK3osisuH48N/GVzRWpI4misDuWxZlGOWC5UdBbCCyOi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21628},"type":"commonjs","engines":{"npm":">= 7","node":">= 16"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"gitHead":"7fc6300e5b40d4c332d4455c19dbabb0534edd23","scripts":{"test":"tap","build":"tsc","clean":"git clean -fdxe node_modules","start":"node -i -e 'YAML=require(\"yaml\");YT=require(\"./dist/index.js\")'","pretest":"tsc","prestart":"tsc","prettier":"prettier --write .","prepublishOnly":"npm run clean && npm run test"},"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"prettier":{"semi":false,"arrowParens":"avoid","singleQuote":true,"trailingComma":"none"},"repository":{"url":"git+https://github.com/eemeli/yaml-types.git","type":"git"},"_npmVersion":"9.5.1","description":"Useful JavaScript types for YAML","directories":{},"_nodeVersion":"19.8.1","_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.4","yaml":"^2.3.0","prettier":"^2.8.7","@types/tap":"^15.0.8","typescript":"^5.0.4"},"peerDependencies":{"yaml":"^2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/yaml-types_0.3.0_1685514149887_0.701307514642693","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"yaml-types","version":"0.4.0","license":"ISC","author":{"name":"Eemeli Aro","email":"eemeli@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/eemeli/yaml-types.git"},"description":"Useful JavaScript types for YAML","keywords":["YAML","schema","tags"],"homepage":"https://eemeli.org/yaml/","type":"commonjs","exports":{".":"./dist/index.js","./package.json":"./package.json"},"scripts":{"build":"tsc","clean":"git clean -fdxe node_modules","prettier":"prettier --write .","prepublishOnly":"npm run clean && npm run test","prestart":"tsc","start":"node -i -e 'YAML=require(\"yaml\");YT=require(\"./dist/index.js\")'","pretest":"tsc","test":"tap"},"prettier":{"arrowParens":"avoid","semi":false,"singleQuote":true,"trailingComma":"none"},"tap":{"exclude":[],"include":["dist/*.test.js"]},"engines":{"node":">= 16","npm":">= 7"},"devDependencies":{"@types/tap":"^15.0.8","prettier":"^3.3.2","tap":"^19.2.5","typescript":"^5.0.4","yaml":"^2.3.0"},"peerDependencies":{"yaml":"^2.3.0"},"_id":"yaml-types@0.4.0","gitHead":"6e68239273b12ebbd1392a535a1db8c4e514ee48","bugs":{"url":"https://github.com/eemeli/yaml-types/issues"},"_nodeVersion":"22.3.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-XfbA30NUg4/LWUiplMbiufUiwYhgB9jvBhTWel7XQqjV+GaB79c2tROu/8/Tu7jO0HvDvnKWtBk5ksWRrhQ/0g==","shasum":"e0cab9fb563cbf6f5fc0a40dd3b8cc7bfa06365e","tarball":"https://registry.npmjs.org/yaml-types/-/yaml-types-0.4.0.tgz","fileCount":21,"unpackedSize":24041,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+lSBNBy/2e4DwmuFyPD9sNUH+83mBYbreCAeNtY/JEwIgCsnMSOHi3wFwmsPGos9rKtYDCgmxohKhovLX4h/20aU="}]},"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yaml-types_0.4.0_1720358960964_0.7460688218682274"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-14T16:50:42.267Z","modified":"2024-07-07T13:29:21.338Z","0.1.0":"2023-04-14T16:50:42.433Z","0.2.0":"2023-05-23T11:40:55.040Z","0.3.0":"2023-05-31T06:22:30.027Z","0.4.0":"2024-07-07T13:29:21.178Z"},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"author":{"name":"Eemeli Aro","email":"eemeli@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/eemeli/yaml-types.git"},"keywords":["YAML","schema","tags"],"license":"ISC","homepage":"https://eemeli.org/yaml/","bugs":{"url":"https://github.com/eemeli/yaml-types/issues"},"readme":"# yaml-types\n\nAdditional useful types for [`yaml`](https://github.com/eemeli/yaml).\n\n## Installation and Usage\n\n```\nnpm install yaml yaml-types\n```\n\nEach type (a.k.a. \"tag\") is available as a named export of `'yaml-types'`.\nThese may then be used as [custom tags](https://eemeli.org/yaml/#writing-custom-tags):\n\n```js\nimport { parse } from 'yaml'\nimport { regexp } from 'yaml-types'\n\nconst re = parse('!re /fo./g', { customTags: [regexp] })\n'foxbarfoo'.match(re) // [ 'fox', 'foo' ]\n```\n\n## Available Types\n\n- `bigint` (`!bigint`) - JavaScript [BigInt] values.\n  Note: in order to use this effectively,\n  a function must be provided as `customTags` in order to prepend the `bigint` tag,\n  or else the built-in `!!int` tags will take priority.\n  See [bigint.test.ts](./src/bigint.test.ts) for examples.\n- `binary` (`!!binary`) - JavaScript [Uint8Array], one of the YAML 1.1 tags\n- `classTag` (`!class`) - JavaScript [Class] values\n- `error` (`!error`) - JavaScript [Error] objects\n- `functionTag` (`!function`) - JavaScript [Function] values\n  (will also be used to stringify Class values,\n  unless the `classTag` tag is loaded ahead of `functionTag`)\n- `nullobject` (`!nullobject`) - Object with a `null` prototype\n- `omap` (`!!omap`) - JavaScript [Map], one of the YAML 1.1 tags\n- `pairs` (`!!pairs`) - Ordered sequence of key-value [pairs], one of the YAML 1.1 tags\n- `regexp` (`!re`) - [RegExp] values,\n  using their default `/foo/flags` string representation.\n- `set` (`!!set`) - JavaScript [Set], one of the YAML 1.1 tags\n- `sharedSymbol` (`!symbol/shared`) - [Shared Symbols],\n  i.e. ones created with `Symbol.for()`\n- `symbol` (`!symbol`) - [Unique Symbols]\n- `timestamp` (`!!timestamp`) - JavaScript [Date], one of the YAML 1.1 tags\n\nThe function and class values created by parsing `!function` and\n`!class` tags will not actually replicate running code, but\nrather no-op function/class values with matching name and\n`toString` properties.\n\n[BigInt]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt\n[Class]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n[Error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n[Function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions\n[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\n[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions\n[Set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\n[Shared Symbols]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry\n[Uint8Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\n[Unique Symbols]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\n[pairs]: https://yaml.org/type/pairs.html\n\n## Customising Tag Names\n\nTo use one of the types with a different tag identifier, set its `tag` value accordingly.\nFor example, to extend the default tag namespace with `!!js/symbol`\ninstead of using a local `!symbol` tag for Symbol values:\n\n```js\nimport { stringify } from 'yaml'\nimport { symbol } from 'yaml-types'\n\nconst mysymbol = { ...symbol, tag: 'tag:yaml.org,2002:js/symbol' }\nstringify(Symbol('foo'), { customTags: [mysymbol] })\n```\n\n```yaml\n!!js/symbol foo\n```\n\nTo use a named tag handle like `!js!symbol`, a few more steps are required:\n\n```js\nimport { Document } from 'yaml'\nimport { symbol } from 'yaml-types'\n\nconst mysymbol = { ...symbol, tag: 'tag:js:symbol' }\nconst doc = new Document(Symbol('foo'), { customTags: [mysymbol] })\ndoc.directives.tags['!js!'] = 'tag:js:'\ndoc.toString()\n```\n\n```yaml\n%TAG !js! tag:js:\n---\n!js!symbol foo\n```\n\n## Contributing\n\nAdditions to this library are very welcome!\nMany data types are useful beyond any single project,\nand while the core `yaml` library is mostly limited to the YAML spec,\nno such restriction applies here.\n\nThe source code is written in [TypeScript], and the tests use [Node-Tap].\nWhen submitting a PR for a new type, tests and documentation are required,\nas well as satisfying [Prettier].\n\n[TypeScript]: https://www.typescriptlang.org/\n[Node-Tap]: https://node-tap.org/\n[Prettier]: https://prettier.io/\n","readmeFilename":"README.md"}