
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@ember-data-mirror/json-api
Advanced tools
Provides a JSON:API document and resource cache implementation for EmberData
Elegantly composable. Made for JSON:API
This package provides an in-memory document and resource Cache and associated utilities for use with EmberData and JSON:API.
Install using your javascript package manager of choice. For instance with pnpm
pnpm add @ember-data-mirror/json-api
If this package is how you are first learning about EmberData, we recommend starting with learning about the Store and Requests
Note When using ember-data the below configuration is handled for you automatically.
import Store from '@ember-data-mirror/store';
import Cache from '@ember-data-mirror/json-api';
export default class extends Store {
createCache(wrapper) {
return new Cache(wrapper);
}
}
Usually you will directly interact with the cache only if implementing a presentation class. Below we
give an example of a read-only record (mutations never written back to the cache). More typically cache
interactions are something that the Store coordinates as part of the request/response lifecycle.
import Store, { recordIdentifierFor } from '@ember-data-mirror/store';
import Cache from '@ember-data-mirror/json-api';
import { TrackedObject } from 'tracked-built-ins';
class extends Store {
createCache(wrapper) {
return new Cache(wrapper);
}
instantiateRecord(identifier) {
const { cache, notifications } = this;
const { type, id } = identifier;
// create a TrackedObject with our attributes, id and type
const attrs = cache.peek(identifier).attributes;
const data = Object.assign({}, attrs, { type, id });
const record = new TrackedObject(data);
// update the TrackedObject whenever attributes change
const token = notifications.subscribe(identifier, (_, change) => {
if (change === 'attributes') {
Object.assign(record, cache.peek(identifier).attributes);
}
});
// setup the ability to teardown the subscription when the
// record is no longer needed
record.destroy = () => {
this.notifications.unsubscribe(token);
};
return record;
}
teardownRecord(record: FakeRecord) {
record.destroy();
}
}
For the full list of APIs available read the code documentation for EmberData Cache
Request builders are functions that produce Fetch Options. They take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.
For instance, to fetch a resource from your API
import { findRecord } from '@ember-data-mirror/json-api/request';
const options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });
/*
=> {
url: 'https://api.example.com/v1/ember-developers/1?include=friends,pets',
method: 'GET',
headers: <Headers>,
// => 'Accept': 'application/vnd.api+json'
// => 'Content-Type': 'application/vnd.api+json'
op: 'findRecord';
records: [{ type: 'ember-developer', id: '1' }]
}
*/
Request builder output may be used with either requestManager.request or store.request.
URLs are stable. The same query will produce the same URL every time, even if the order of keys in the query or values in an array changes.
URLs follow the most common JSON:API format (dasherized pluralized resource types).
FAQs
Provides a JSON:API document and resource cache implementation for EmberData
The npm package @ember-data-mirror/json-api receives a total of 104 weekly downloads. As such, @ember-data-mirror/json-api popularity was classified as not popular.
We found that @ember-data-mirror/json-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.