Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
api-data-store
Advanced tools
API Data store
A Data Store that will run the same API endpoint once, cache results, and expire after a timeout.
import axios from 'axios';
import ApiDataStore from 'api-data-store';
const users = await ApiDataStore.fetch('/api/v1/users', {
fetchMethod: axios.get,
});
import axios from 'axios';
import ApiDataStore from 'api-data-store';
ApiDataStore.setFetchMethod(axois.get);
const users = await ApiDataStore.fetch('/api/v1/users');
import axios from 'axios';
import ApiDataStore from 'api-data-store';
ApiDataStore.setFetchMethod(axois.get);
const users = await ApiDataStore.fetch('/api/v1/users', {
cache: true,
});
ApiDataStore.setPrefix('your-api-name:');
// local storage:
// your-api-name:/api/v1/users = { ...data }
const users = await ApiDataStore.fetch('/api/v1/users', {
cache: true,
timeout: 1000 * 60 * 5 // 5 minutes
});
The API Data Store uses the localStorage interface. If you need to create your own custom storage driver use the same methods as localStorage.
import axios from 'axios';
import ApiDataStore from 'api-data-store';
import MemoryDataStore from 'api-data-store/memoryDataStore';
ApiDataStore.setFetchMethod(axois.get);
ApiDataStore.setStorageDriver(MemoryDataStore);
const users = await ApiDataStore.fetch('/api/v1/users', {
cache: true,
timeout: 1000 * 60 * 5 // 5 minutes
});
FAQs
API Data Store
We found that api-data-store 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.