Registry / testing / ember-intl-format-cache

ember-intl-format-cache

JSON →
library2.6.0jsnpmunverified

Ember addon that provides a wrapper around intl-format-cache for use in Ember applications. Current stable version 2.6.0. Release cadence is low (last release likely older). It allows importing intl-format-cache within Ember's module system, but is largely deprecated in favor of using intl-format-cache directly or newer Ember Intl patterns. Key differentiator: specifically for Ember apps; otherwise superseded by native imports.

npm install ember-intl-format-cache
INSTALL
IMPORT
SIG · EMBER-INTL-FORMAT-
E
ember-intl-format-cache
testingjavascriptv2.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import intlFormatCache from 'ember-intl-format-cache';
const intlFormatCache = require('ember-intl-format-cache');
ESM default import is standard. CJS require may not work with Ember's resolver.
default
import intlFormatCache from 'ember-intl-format-cache';
import { intlFormatCache } from 'ember-intl-format-cache';
This package exports a default, not a named export.
default
import intlFormatCache from 'ember-intl-format-cache';
import intlFormatCache from 'intl-format-cache';
Direct import from intl-format-cache may not resolve in Ember's addon system; use this wrapper.

Shows how to import default export and use intlFormatCache to create cached formatters.

import intlFormatCache from 'ember-intl-format-cache'; const getDateTimeFormat = intlFormatCache(Intl.DateTimeFormat); const formatter = getDateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); console.log(formatter.format(new Date())); // Outputs: June 15, 2023 // With caching: same arguments return cached formatter const formatter2 = getDateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); console.log(formatter === formatter2); // true
Debug
Known issues
deprecatedPackage is deprecated: use intl-format-cache directly or Ember Intl's built-in caching.
fix
Replace with npm package 'intl-format-cache' or migrate to @ember-intl/format-cache.
affects: >=2.6.0
gotchaThis addon is only useful within an Ember application; standalone Node.js usage is unsupported.
fix
Use intl-format-cache directly outside Ember.
affects: all
gotchaRequires Ember CLI and may not work with modern Ember Octane or Embroider builds.
fix
Check compatibility with your Ember version; consider alternatives.
affects: <3.0?
Errors
Common errors & fixes
Cannot find module 'ember-intl-format-cache'
Package not installed or not properly resolved in Ember addon context.
fix
npm install ember-intl-format-cache --save-dev
TypeError: intlFormatCache is not a function
Incorrect import (named instead of default) or the cache function not called correctly.
fix
Use: import intlFormatCache from 'ember-intl-format-cache'; then invoke as function: intlFormatCache(Intl.DateTimeFormat)
EmberError: The addon ember-intl-format-cache was not found in the resolver
Addon not installed or incorrectly listed in package.json dependencies.
fix
Ensure ember-intl-format-cache is in devDependencies (not dependencies) and run ember install ember-intl-format-cache
Upgrade
Version history
2.6.0latest on npm
Audit
Dependencies
intl-format-cacherequiredCore functionality: caching Intl format objects.
Agent activity
5 hits · last 30 days
node
4
Resources
ember-intl-format-cache — npm install ember-intl-format-cache · libregistry