
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
Node.JS-client for Nasjonal Turbase.
npm install turbasen --save
var turbasen = require('turbasen');
| Data Type | API object |
|---|---|
| Areas | turbasen.områder.… |
| Photos | turbasen.bilder.… |
| Places | turbasen.steder.… |
| Trips | turbasen.turer.… |
| Activities | turbasen.aktiviteter.… |
| Groups | turbasen.grupper.… |
| Code | Explanation |
|---|---|
200 | Everything is OK |
201 | Object created |
204 | As 200 without any body |
400 | Body is missing |
400 | ObjectId is invalid |
401 | Credentials are invalid |
403 | Rate limit is exceeded |
403 | Request was denied |
404 | Resource was not found |
404 | Object was not found |
405 | HTTP method X is not allowed |
422 | Body should be a JSON Hash |
422 | Data validation failed |
500 | Internal server error |
The following configurations are read from environment variables when this module is loaded:
NTB_API_KEY - API key for authenticate requestsNTB_API_ENV - API environment (default api, can be dev)NTB_USER_AGENT - User Agent for API requestsThese configurations can be overloaded using the turbasen.configure() like
this:
turbasen.configure({
API_KEY: 'my-api-key',
API_ENV: 'dev',
USER_AGENT: 'my-app/1.2.3'
});
turbasen.omrĂĄder(query, function(err, res, body) {
if (err) { throw err; }
console.log(body.count);
console.log(body.documents);
});
Asyncronously featch each object for a given query.
function each(item, next) {
// do something async with the item
next();
};
turbasen.omrĂĄder.each(query, each, function(err) {
// we are done!
});
turbasen.bilder.post(object, function(err, res, body) {
if (err) { throw err; }
if (res.statusCode !== 201) {
console.error(body.message);
console.error(body.errors);
} else {
console.log(body);
}
});
turbasen.bilder.get(id, function(err, res, body) {
if (err) { throw err; }
if (res.statusCode !== 200) {
console.error(body.message);
} else {
console.log(body);
}
});
turbasen.bilder.delete(id, function(err, res, body) {
if (err) { throw err; }
if (res.statusCode !== 204) {
console.error(body.message);
} else {
console.log('Document deleted successfully!');
}
});
turbasen.bilder.put(id, object, function(err, res, body) {
if (err) { throw err; }
if (res.statusCode !== 200) {
console.log(body.errors);
} else {
console.warn(body.warnings);
console.log(body.document);
}
});
turbasen.bilder.patch(id, object, function(err, res, body) {
if (err) { throw err; }
if (res.statusCode !== 200) {
console.log(body.errors);
} else {
console.warn(body.warnings);
console.log(body.document);
}
});
FAQs
Node.JS-client for Nasjonal Turbase
We found that turbasen 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
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.