prefix-cc

1.0.1 • Public • Published

prefix.cc client

Build Status npm Version

JavaScript and command line client to http://prefix.cc.

Install (Command Line)

npm install -g prefix-cc

Usage (Command Line)

Looking up one prefix

$ prefix-cc dc
http://purl.org/dc/elements/1.1/

Looking up multiple prefixes

$ prefix-cc dc owl rdf foaf
dc: http://purl.org/dc/elements/1.1/
owl: http://www.w3.org/2002/07/owl#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
foaf: http://xmlns.com/foaf/0.1/

Usage (JavaScript)

import prefix from "prefix-cc";
 
// Pass each desired prefix an argument.
// prefix() returns a promise.
prefix('rdf', 'foaf', 'owl').then(prefixes => {
   // The promise is resolved with an object mapping each prefix to
   // its URI.
 
   // prefixes === {
   //  rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
   //  foaf: "http://xmlns.com/foaf/0.1/",
   //  owl: "http://www.w3.org/2002/07/owl#"
   // };
 
   console.log(prefixes.rdf);
   // prints "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
});

License

Copyright © 2016 Eddie Antonio Santos. MIT Licensed.

Readme

Keywords

Package Sidebar

Install

npm i prefix-cc

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • eddieantonio