Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# http://editorconfig.org
# https://editorconfig.org

root = true

Expand Down
7 changes: 7 additions & 0 deletions bin/jsonld.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ program

_jsonLdCommand(program.command('format [filename|URL|-]'))
.description('format and convert JSON-LD')
.option('-c, --context <filename|URL>', 'context filename or URL')
.option('-f, --format <format>', 'output format [json]', String)
.option('-q, --n-quads', 'output application/n-quads [false]')
.option('-j, --json', 'output application/json [true]')
Expand Down Expand Up @@ -297,6 +298,7 @@ _jsonLdCommand(program.command('format [filename|URL|-]'))

_jsonLdCommand(program.command('lint [filename|URL|-]'))
.description('lint JSON-LD')
.option('-c, --context <filename|URL>', 'context filename or URL')
.action(async function lint(input, cmd) {
input = input || '-';
const options = _jsonLdOptions(cmd, input);
Expand Down Expand Up @@ -329,9 +331,14 @@ _jsonLdCommand(program.command('compact [filename|URL]'))

_jsonLdCommand(program.command('expand [filename|URL|-]'))
.description('expand JSON-LD')
.option('-c, --context <filename|URL>', 'context filename or URL')
.option(' --keep-free-floating-nodes', 'keep free-floating nodes')
.action(async function expand(input, cmd) {
input = input || '-';
if(cmd.context) {
cmd.expandContext = cmd.context;
delete cmd.context;
}
const options = _jsonLdOptions(cmd, input);
options.keepFreeFloatingNodes = cmd.keepFreeFloatingNodes;

Expand Down
Loading