open-index/open-npm huggingface dataset:
npm package: @lydio/schema
Description: JSON-LD Schema node for Lydio
Author: Alex Stevovich
Latest version: 3.0.3

# @lydio/schema

**Canonical URL:**  
[https://alexstevovich.com/a/lydio-schema-nodejs](https://alexstevovich.com/a/lydio-schema-nodejs)

**Software URL:**  
[https://midnightcitylights.com/software/lydio-schema-nodejs](https://midnightcitylights.com/software/lydio-schema-nodejs)

**JSON-LD Schema node for [Lydio](https://alexstevovich.com/a/lydio-nodejs).**

`@lydio/schema` provides a structured way to include [JSON-LD](https://json-ld.org) schema data inside HTML documents generated with Lydio.  
It automatically formats your schema into a `<script type="application/ld+json">` element.

---

## Installation

```sh
npm install @lydio/schema
```

## Example

```js
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](https://www.apache.org/licenses/LICENSE-2.0).

## Trademark

“Lydio” and related marks are trademarks of [Alex Stevovich](https://alexstevovich.com).

See [TRADEMARK.md](./TRADEMARK.md) for details.