![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
osm-request
Advanced tools
Request the OSM API (v0.6) from Javascript, with promises :)
npm install osm-request
The full documentation of osm-request API is detailed in the API documentation.
OSM Request use the same configurations properties as osm-auth 2.5.0. So you can define your options in a constante conf variable and use it both for osm-request and osm-auth.
Register new application
name
for your app, example: demo-app
Redirect URI
Register
Client ID
Client Secret
is not needed, no need to copy it, also make sure not to disclose itNote that OAuth 2.0 do no need the Client Secret
to work. So it is safe to publish the Client ID
of your app online. For example, you can create a browser/JavaScript app containing your Client ID
and publish it online (on GitHub pages, etc).
The bellow example only show how to use osm-request. But to work, it needs first that you connect the user of your app to OSM throught osm-auth. To connect your user, please read osm-auth readme
import OsmRequest from 'osm-request';
const conf = {
scope: 'read_prefs write_api', // To customize
client_id: "YOUR_CLIENT_ID", // To customize
redirect_uri: '',
url: 'https://www.openstreetmap.org',
apiUrl: 'https://api.openstreetmap.org',
auto: true,
singlepage: true
};
const osmRequest = new OsmRequest(conf);
async function start() {
let element = await osmRequest.fetchElement('node/3683625932');
element = osmRequest.setTag(element, 'key', 'value');
element = osmRequest.setTags(element, {
key1: 'value1',
key2: 'value2',
key3: 'value3',
});
element = osmRequest.removeTag(element, 'key2');
element = osmRequest.setTimestampToNow(element);
element = osmRequest.setCoordinates(element, 1.234, 0.456);
const changesetId = await osmRequest.createChangeset('Created by me', 'My changeset comment');
const isChangesetStillOpen = await osmRequest.isChangesetStillOpen(changesetId);
const newElementVersion = await osmRequest.sendElement(element, changesetId);
element = osmRequest.setVersion(element, newElementVersion);
}
start();
For the OSM dev instance, use that apiUrl: https://api06.dev.openstreetmap.org
To start contribute on this project, you can retrieve code using the following commands:
git clone git@github.com:osmlab/osm-request.git
cd osm-request
npm install
npm run watch
This project uses a specific work flow for branches:
master
branch is dedicated to releases, managed by repo maintainersdevelop
branch is for currently developed version, managed by repo maintainersfeature/...
branches are for all developers, working on a particular featurePull requests are welcome, as the project is fully open-source. If you want to work on new features, please create a branch named feature/yourFeatureName
. When work is done, open a pull request to merge your branch on develop
branch. The code will be reviewed by one or several developers before being merged, in order to keep a good code quality.
For now eslint stays in version 8.X. We need to wait until babel, babel plugins and eslint plugins (that we use), are compatibles with version 9.X of eslint.
git checkout develop
git pull origin develop
npm version patch -m "release: %s"
npm publish
git checkout master
git pull origin master
git merge develop
git push origin master
npm version
tests the code, builds it and updates the doc. Then it upgrades the package version number according to the used keyword (patch, minor or major) and commits the modifications in Git (with a proper version tag). Finally, it pushes it to repository with the tag.
FAQs
Request the OSM API from Javascript, with promises :)
We found that osm-request demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.