@lydio/schema
v3.0.3
Published
JSON-LD Schema node for Lydio
Maintainers
Readme
@lydio/schema
Canonical URL:
https://alexstevovich.com/a/lydio-schema-nodejs
Software URL:
https://midnightcitylights.com/software/lydio-schema-nodejs
JSON-LD Schema node for Lydio.
@lydio/schema provides a structured way to include JSON-LD schema data inside HTML documents generated with Lydio.
It automatically formats your schema into a <script type="application/ld+json"> element.
Installation
npm install @lydio/schemaExample
import Schema from '@lydio/schema';
const schema = new Schema();
schema.withSchema({
'@type': 'Organization',
name: 'Example Company',
url: 'https://example.com',
});
console.log(schema.toHtml());
/*
<script type="application/ld+json">
{"@context":"https://schema.org","@graph":[{"@type":"Organization","name":"Example Company","url":"https://example.com"}]}
</script>
*/License
Licensed under the Apache License 2.0.
Trademark
“Lydio” and related marks are trademarks of Alex Stevovich.
See TRADEMARK.md for details.
