
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.
A TypeScript library that simplifies working with Wikidata through an intuitive object-oriented interface. Wikidata is a free knowledge base that anyone can edit, serving as a central storage for structured data used by Wikipedia and other Wikimedia projects.
npm i --save iwf
You can easily request an item from Wikidata and list all the labels. For example, Q42 represents Douglas Adams in Wikidata:
import { requestItem } from 'iwf';
// Request the item for Douglas Adams (Q42)
const item = await requestItem('Q42', { userAgent: 'YourApp/1.0' });
// Prints all available labels in different languages
console.log(item.labels);
Create a new item and upload it to Wikidata. This example creates a new astronomical object:
import { Item, BotPasswordAuth, upload, Label, Statement, WikibaseItemSnak } from 'iwf';
const item = Item.fromNothing();
// Add an English label
item.labels.push(Label.fromString('en', 'new planet'));
// Add a statement: instance of (P31) celestial body (Q634)
item.statements.push(Statement.fromSnak(WikibaseItemSnak.fromID('P31', 'Q634')));
// Authenticate with bot password and upload
const auth = new BotPasswordAuth({
username: 'YourUsername@YourBotName',
password: 'your-bot-password',
userAgent: 'YourApp/1.0 (your@email.com)'
});
await upload(item, {
summary: 'Adding new astronomical object',
auth
});
The library supports Bot Password authentication for editing operations. Bot passwords are app-specific passwords that can be created in your Wikidata account settings.
Example with Bot Password:
import { Item, BotPasswordAuth, Label, Statement, WikibaseItemSnak } from 'iwf';
// Create auth provider
const auth = new BotPasswordAuth({
username: 'YourUsername@YourBotName',
password: 'your-bot-password',
userAgent: 'YourApp/1.0 (your@email.com)'
});
// Create and modify item
const item = Item.fromNothing();
item.labels.push(Label.fromString('en', 'new planet'));
item.statements.push(Statement.fromSnak(WikibaseItemSnak.fromID('P31', 'Q634')));
// Get CSRF token for API calls
const csrfToken = await auth.getCsrfToken('https://www.wikidata.org');
To see all the functionality, extra documentation, and examples, visit the documentation.
You are already helping by using this library, but if you want to do more, there are a few things you can do:
There is a FUTURE.md file that contains ideas for future development. If you want to help, you can look there for ideas.
FAQs
improved wikidata format
We found that iwf demonstrated a healthy version release cadence and project activity because the last version was released less than 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.