1.0.1 • Published 8 years ago

prefix-cc v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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.

1.0.1

8 years ago

1.0.0

8 years ago