{"_id":"@rdfjs/formats","_rev":"3-5f8f25fde7d54e4a8e234a88bee9e57d","name":"@rdfjs/formats","dist-tags":{"latest":"4.0.1"},"versions":{"4.0.0":{"name":"@rdfjs/formats","version":"4.0.0","keywords":["rdf","rdfjs","format","parser","serializer"],"author":{"url":"https://www.bergnet.org/people/bergi/card#me","name":"Thomas Bergwinkl","email":"bergi@axolotlfarm.org"},"license":"MIT","_id":"@rdfjs/formats@4.0.0","maintainers":[{"name":"bergos","email":"bergi@bergnet.org"}],"homepage":"https://github.com/rdfjs-base/formats","bugs":{"url":"https://github.com/rdfjs-base/formats/issues"},"dist":{"shasum":"8d629ac9563e3a19e4c701d225c4136d401ced0f","tarball":"https://registry.npmjs.org/@rdfjs/formats/-/formats-4.0.0.tgz","fileCount":16,"integrity":"sha512-9e0DX+iWi8d958Px6Ggb1otl/EhfyvlfWcop+lS0aZlsGV2YK9Phl5lzCUYTfTefSyyQk8tJd5XN52hhDLb5Wg==","signatures":[{"sig":"MEUCIQD97sKSe2KZwfhSYZPdF1igq/7z1Vs2A94IFo7fZg3dawIgbiIbRQgWiatYv3KQ1+P0P+pg3Z895fUQ6rrgY9PmzHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18823},"main":"index.js","type":"module","gitHead":"04b6d0bbcac96d3bc4ee329abed58487ef76e5b4","scripts":{"test":"stricter-standard && c8 --reporter=lcov --reporter=text mocha"},"_npmUser":{"name":"bergos","email":"bergi@bergnet.org"},"repository":{"url":"git+https://github.com/rdfjs-base/formats.git","type":"git"},"_npmVersion":"8.19.3","description":"Bundle of RDF/JS parsers and serializers","directories":{},"_nodeVersion":"18.13.0","dependencies":{"@rdfjs/sink-map":"^2.0.0","@rdfjs/parser-n3":"^2.0.1","@rdfjs/parser-jsonld":"^2.1.0","rdfxml-streaming-parser":"^2.3.0","@rdfjs/serializer-jsonld":"^2.0.0","@rdfjs/serializer-turtle":"^1.1.1","@rdfjs/serializer-ntriples":"^2.0.0","@rdfjs/serializer-jsonld-ext":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","mocha":"^10.2.0","stricter-standard":"^0.3.0","@rdfjs/environment":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/formats_4.0.0_1700343693997_0.3822229852658725","host":"s3://npm-registry-packages"}},"4.0.1":{"name":"@rdfjs/formats","version":"4.0.1","keywords":["rdf","rdfjs","format","parser","serializer"],"author":{"url":"https://www.bergnet.org/people/bergi/card#me","name":"Thomas Bergwinkl","email":"bergi@axolotlfarm.org"},"license":"MIT","_id":"@rdfjs/formats@4.0.1","maintainers":[{"name":"bergos","email":"bergi@bergnet.org"}],"homepage":"https://github.com/rdfjs-base/formats","bugs":{"url":"https://github.com/rdfjs-base/formats/issues"},"dist":{"shasum":"996aab3d05ce3911537d30989d629f675289db89","tarball":"https://registry.npmjs.org/@rdfjs/formats/-/formats-4.0.1.tgz","fileCount":17,"integrity":"sha512-Rg53vP+x1bnGAqJNKgEzJEUPDhj+tCpzb6wdmfLoVFq4XoZ589+cg2ScFDUMMyAVsgKXvSWjDhQ9f9ab254ZxA==","signatures":[{"sig":"MEYCIQCZh7QfV3IoBsUfkWZihL5EqSrxe5/3tA8J+P2WUAlixwIhALAZN4RU5x86umnxvhI5y3cBKfyerieA0UPg6jQL3xD3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19432},"main":"index.js","type":"module","gitHead":"28e68f348db15263f3ba1b25f8eb550152b69136","scripts":{"test":"stricter-standard && c8 --reporter=lcov --reporter=text mocha"},"_npmUser":{"name":"bergos","email":"bergi@bergnet.org"},"repository":{"url":"git+https://github.com/rdfjs-base/formats.git","type":"git"},"_npmVersion":"10.2.4","description":"Bundle of RDF/JS parsers and serializers","directories":{},"_nodeVersion":"20.11.0","dependencies":{"@rdfjs/sink-map":"^2.0.0","@rdfjs/parser-n3":"^2.0.1","@rdfjs/parser-jsonld":"^2.1.0","rdfxml-streaming-parser":"^3.0.1","@rdfjs/serializer-jsonld":"^2.0.0","@rdfjs/serializer-turtle":"^1.1.1","@rdfjs/serializer-ntriples":"^2.0.0","@rdfjs/serializer-jsonld-ext":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","mocha":"^11.0.1","stricter-standard":"^0.3.0","@rdfjs/environment":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/formats_4.0.1_1736545060023_0.8857832863308752","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2023-11-18T21:41:33.889Z","modified":"2026-02-11T20:56:36.981Z","4.0.0":"2023-11-18T21:41:34.193Z","4.0.1":"2025-01-10T21:37:40.195Z"},"bugs":{"url":"https://github.com/rdfjs-base/formats/issues"},"author":{"url":"https://www.bergnet.org/people/bergi/card#me","name":"Thomas Bergwinkl","email":"bergi@axolotlfarm.org"},"license":"MIT","homepage":"https://github.com/rdfjs-base/formats","keywords":["rdf","rdfjs","format","parser","serializer"],"repository":{"url":"git+https://github.com/rdfjs-base/formats.git","type":"git"},"description":"Bundle of RDF/JS parsers and serializers","maintainers":[{"email":"bergi@bergnet.org","name":"bergos"},{"email":"matthieubosquet@gmail.com","name":"matthieubosquet"}],"readme":"# @rdfjs/formats\n\n[![build status](https://img.shields.io/github/actions/workflow/status/rdfjs-base/formats/test.yaml?branch=master)](https://github.com/rdfjs-base/formats/actions/workflows/test.yaml)\n[![npm version](https://img.shields.io/npm/v/@rdfjs/formats.svg)](https://www.npmjs.com/package/@rdfjs/formats)\n\nThis module bundles parsers and serializers for the most common RDF formats.\nInstances of [SinkMap](https://github.com/rdfjs-base/sink-map) are used to handle different media types.\n\n## Usage\n\nThe formats object has a `parsers` and `serializers` property.\nEach is an instance of `SinkMap` with the most common RDF media types as key.\nThe formats object is exported as default and can be imported like this:\n\n```javascript\nimport formats from '@rdfjs/formats'\n```\n\n### Pretty-Print Serializers\n\nThe default bundle of serializers is optimized for streaming.\nThe pretty-print formats bundle can be used if a more human-readable output is required.\nIt can be imported like this:\n\n### Factory\n\nA factory that takes care of parsers and serializers.\nAn additional `.formats` object will be attached to the environment.\nThat object is compatible with the data structure of [@rdfjs/formats-common](https://github.com/rdfjs-base/formats-common).\nThe `.formats` object has an additional `.import()` function to import other format bundles.\nThe following code shows how to import the [@rdfjs/formats-common](https://github.com/rdfjs-base/formats-common) bundle:\n\n\n```javascript\nimport formats from '@rdfjs/formats/pretty.js'\n```\n\n## Example\n\nThe following example uses the parser for the media type `text/turtle` to parse the given string.\nThe quads emitted by the `data` event are written to the console:\n\n```javascript\nimport formats from '@rdfjs/formats'\nimport { Readable } from 'readable-stream'\n\nconst input = Readable.from([`\n  PREFIX s: <http://schema.org/>\n\n  [] a s:Person;\n    s:jobTitle \"Professor\";\n    s:name \"Jane Doe\";\n    s:telephone \"(425) 123-4567\";\n    s:url <http://www.janedoe.com>.\n`])\n\nconst output = formats.parsers.import('text/turtle', input)\n\noutput.on('data', quad => {\n  console.log(`quad: ${quad.subject.value} - ${quad.predicate.value} - ${quad.object.value}`)\n})\n\noutput.on('prefix', (prefix, ns) => {\n  console.log(`prefix: ${prefix} ${ns.value}`)\n})\n```\n","readmeFilename":"README.md"}