
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This library should simplify handling PIDF-LO GEOPRIV documents as described in https://tools.ietf.org/html/rfc5491.
This library should simplify handling PIDF-LO GEOPRIV documents as described in https://tools.ietf.org/html/rfc5491.
This README currently only describes simple usage of this library. More elaborate implementation examples will be added by time.
This implemenentation only covers a small portion of the PIDF-LO specification documents and is (by far) not complete. Pull requests are therefore highly honored.
This library requires @xmldom/xmldom as a peer-dependency only in node.js environments!
JavaScript browser environments always have a DOM implementation on board, therefore @xmldom/xmldom is not needed there.
Requires node.js and npm.
npm install pidf-lo
import {
LocationMethod,
PidfLo,
XMLCompat,
getNodeImpl,
getWebImpl,
} from 'pidf-lo';
// if xmldom interface is available (e.g. on web browsers)
XMLCompat.initialize(getNodeImpl());
// if xmldom interface is NOT available (e.g. on node environments)
// also don't forget to install required peer dependency @xmldom/xmldom
XMLCompat.initialize(getWebImpl());
const pidf = PidfLo.fromSimpleLocation({
latitude: 48.123,
longitude: 14.456,
radius: 24,
method: LocationMethod.GPS,
});
if (!pidf)
throw 'Something is wrong with this location';
const xmlObj = pidf.toXML();
console.log(XMLCompat.toXMLString(xmlObj));
import {
PidfLo,
XMLCompat,
getNodeImpl,
getWebImpl,
} from 'pidf-lo';
// if xmldom interface is available (e.g. on web browsers)
XMLCompat.initialize(getNodeImpl());
// if xmldom interface is NOT available (e.g. on node environments)
// also don't forget to install required peer dependency @xmldom/xmldom
XMLCompat.initialize(getWebImpl());
const parsed = PidfLo.fromXML('<xml...>');
if (!parsed || !parsed.simple)
throw 'Something is wrong with this location';
const simpleLoc = parsed.simple;
console.log(`${simpleLoc.latitude} ${simpleLoc.longitude}`);
import {
LocationMethod,
PidfLo,
getNodeImpl,
getWebImpl,
} from 'pidf-lo';
// if xmldom interface is available (e.g. on web browsers)
XMLCompat.initialize(getNodeImpl());
// if xmldom interface is NOT available (e.g. on node environments)
// also don't forget to install required peer dependency @xmldom/xmldom
XMLCompat.initialize(getWebImpl());
const pidf = PidfLo.fromSimpleLocation({
civic: {
country: 'AT',
A1: 'Upper Austria',
A4: 'Schärding',
FLR: '5',
PC: '4780',
NAM: 'Hospital',
},
method: LocationMethod['AP-802.11'],
}, 'lkh-schaerding.at');
if (!pidf)
throw 'Something is wrong with this location';
const xmlObj = pidf.toXML();
console.log(XMLCompat.toXMLString(xmlObj));
import {
PidfLo,
getNodeImpl,
getWebImpl,
} from 'pidf-lo';
// if xmldom interface is available (e.g. on web browsers)
XMLCompat.initialize(getNodeImpl());
// if xmldom interface is NOT available (e.g. on node environments)
// also don't forget to install required peer dependency @xmldom/xmldom
XMLCompat.initialize(getWebImpl());
const parsed = PidfLo.fromXML('<xml...>');
if (!parsed || !parsed.simple || !parsed.simple.civic)
throw 'Something is wrong with this location';
const simpleCivic = parsed.simple.civic;
console.log(`${simpleCivic.country} ${simpleCivic.A1}`);
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Distributed under the MIT License. See LICENSE for more information.
FAQs
This library should simplify handling PIDF-LO GEOPRIV documents as described in https://tools.ietf.org/html/rfc5491.
The npm package pidf-lo receives a total of 5 weekly downloads. As such, pidf-lo popularity was classified as not popular.
We found that pidf-lo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.