npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

oparl

v0.0.1

Published

A JavaScript OParl Client

Downloads

4

Readme

#oparl.js

This is a JavaScript library for the OParl protocoll.

THE LIB IS IN THE BEGINING. PRE-ALPHA...

Some links: the OParl spec, a (real) test system, and a live demo of the oparl.js

##Getting started

You can use oparl.js directly in your HTML/JavaScript file or in your node.js project.

###HTML file

  1. Include the JavaScript lib file in HTML header
<script src="lib/oparl-src.js"></script>
  1. Use the global OParl object
OParl.open(url);

###Node.js

  1. Installation
npm install oparl --save
  1. Usage
var OParl = require('oparl');
OParl.open(url);

###Load first data from the OParl endpoint

Use the function OParl.open with 2 parameters. The first parameter contains the OParl endpoint URI of the requested domain. The second parameter is a callback function called asynchroniously. The callback function with 2 parameters return an error message if the first parameter is non-null. The second contains an oparl:System object, if the call was successful.

OParl.open(uriToOParlServer, function (err, serverObj) {
	if (err !== null) {
		console.error('Something went wrong: ' + err);
	} else {
		console.log(serverObj);
	}
});

##Object types

The OParl.open function serves an oparl:System object to the callback function. First you should read the description of these type.

####item object

|Function |Description |--------------|------------ |get(callback) |The get function collect one object. This could be done by an internet request call. So the function did not return the object, it calls the callback function when it's done.callback(error, object)The error parameter contains an error message or, if it is null, the object parameter contains an object in one of the oparl: types (listed below).

####list object

|Function |Description |--------------|------------ |get(callback) |The get function collect a list of items. This could be done by an internet request call. So the function did not return a list, it calls the callback function when it's done.callback(error, itemList)The error parameter contains an error message or, if it is null, the itemList parameter contains an array of item objects.

To do: the list object should handle the paging and pagination. Currently a maximum of 100 objects will be listed.

####oparl:Body

The oparl:Body object represent one city, country or municipal.

|Parameter |Type |Description |--------------------------------|------------|----------------------------------------------- |objectType |string |is 'oparl:Body' |name |string |the official (and long) name of the body |organizationList |list object |list of all organizations, see object oparl:Organization |personList |list object |list of all persons, see object oparl:Person |meetingList |list object |list of all meetings, see object oparl:Meeting |paperList |list object |list of all papers, see object oparl:Paper |legislativeTermList |list object |list of all legislative terms, see object oparl:LegislativeTerm |systemObject (optional) |item object |the parent OParl system, see object oparl:System |shortName (optional) |string |a shorter version of the body name |website (optional) |string |URI to the ordinary website of the body |license (optional) |string |URI of the used license |licenseValidSince (optional) |Date |last license changed date |oparlSince (optional) |Date |date for the first use of OParl |ags (optional) |string |8 digits of the AGS (the German Amtliche Gemeindeschlüssel) |rgs (optional) |string |12 digits of the RGS (the German Regionalschlüssel) |equivalent (optional) |array |external links for the body |contactEmail (optional) |string |contact mail address |contactName (optional) |string |name of the contact person |classification (optional) |string |classification of the body |location (optional) |string |location of the body | | |^^ type should be changed ^^ |modified (optional) |Date |last modified

####oparl:LegislativeTerm

The oparl:LegislativeTerm object represent one legislative period.

|Parameter |Type |Description |--------------------------------|------------|----------------------------------------------- |objectType |string |is 'oparl:LegislativeTerm' |bodyObject (optional) |item object |the body of the legislation period, see object oparl:Body |name (optional) |string |user friendly title of the legislative period |startDate (optional) |Date |first day of the legislative period |endDate (optional) |Date |last day of the legislative period

####oparl:Organization

The oparl:Organization object represent one organization unit.

|Parameter |Type |Description |--------------------------------|------------|----------------------------------------------- |objectType |string |is 'oparl:Organization' |bodyObject (optional) |item object |the body of the organization, see object oparl:Body |name (optional) |string |the official (and long) name of the organization |membershipList (optional) |list object |list of all memberships, see object oparl:Membership |meetingList (optional) |list object |list of all meetings, see object oparl:Meeting |shortName (optional) |string |a shorter version of the organization name |post (optional) |array |array of strings |subOrganizationOfObject (optional) |item object |a superior organization, see object oparl:Organization |organizationType (optional) |string |type of the organization |classification (optional) |string |group of the organization |startDate (optional) |Date |date of formation |endDate (optional) |Date |date of termination |website (optional) |string |URI of the organization website |locationObject (optional) |item object |location of the organization, see object oparl:Location |externalBodyObject (optional) |item object |the body of an external OParl system, see object oparl:Body

####oparl:System

The oparl:System object is the entry point for all clients. It defines basic information of the OParl system.

|Parameter |Type |Description |--------------------------------|------------|----------------------------------------------- |objectType |string |is 'oparl:System' |oparlVersion |string |version number of supported OParl |bodyList |list object |list of all bodies, see object oparl:Body |otherOparlVersions (optional) |array |array of URIs | | |^^ type should be changed ^^ |license (optional) |string |URI of the used license |name (optional) |string |user friendly title of the system |contactEmail (optional) |string |contact email address |contactName (optional) |string |name of the contact person |website (optional) |string |URI of the RIS website |vendor (optional) |string |URI of the vendor of the RIS software |product (optional) |string |URI of the software product

####not yet ready object types

oparl:Person
oparl:Membership
oparl:Meeting
oparl:AgendaItem
oparl:Paper
oparl:Consultation
oparl:File
oparl:Location
oparl:Membership
oparl:AgendaItem
oparl:Consultation
oparl:File
oparl:Location

##Contributing

##Release History

  • 0.0.1 Initial release

##License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.