Socket
Socket
Sign inDemoInstall

@ldo/cli

Package Overview
Dependencies
8
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ldo/cli

A Command Line Interface for Linked Data Objects


Version published
Weekly downloads
148
decreased by-30.19%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@ldo/cli

The @ldo/cli is a command line interface for initializing LDO and building ShapeTypes.

Setup

Automatic Setup

To setup LDO, cd into your typescript project and run npx @ldo/cli init.

cd my-typescript-project
npx @ldo/cli init

Manual Setup

The following is handled by the automatic setup:

Install the LDO dependencies.

npm install @ldo/ldo
npm install @ldo/cli --save-dev

Create a folder to store your ShEx shapes:

mkdir shapes

Create a script to build ShEx shapes and convert them into Linked Data Objects. You can put this script in package.json

{
  ...
  scripts: {
    ...
    "build:ldo": "ldo build --input ./shapes --output ./ldo"
    ...
  }
  ...
}

Generating a ShapeType

@ldo/cli generates shape types using the *.shex files in the "input" folder. If you followed the instructions above, run the following command:

npm run build:ldo

This will generate five files:

  • ./ldo/foafProfile.shapeTypes.ts <-- This is the important file
  • ./ldo/foafProfile.typings.ts
  • ./ldo/foafProfile.schema.ts
  • ./ldo/foafProfile.context.ts

API Details

  • init command
  • build command

## Sponsorship
This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/).

[<img src="https://nlnet.nl/logo/banner.png" alt="nlnet foundation logo" width="300" />](https://nlnet.nl/)
[<img src="https://nlnet.nl/image/logos/NGI0Entrust_tag.svg" alt="NGI Zero Entrust Logo" width="300" />](https://nlnet.nl/)

## Liscense
MIT

FAQs

Last updated on 24 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc