@stackline/moment-core
v1.0.5
Published
Maintained Moment.js API package for parsing, validating, manipulating, and formatting dates.
Maintainers
Readme
@stackline/moment-core
Maintained Moment.js API package for parsing, validating, manipulating, and formatting dates.
Documentation | npm | Issues | Repository
Current package version: 1.0.5
Why this package?
@stackline/moment-core is maintained as part of the Stackline package collection.
Compatibility
| Item | Value |
| :--- | :--- |
| Package | @stackline/[email protected] |
| API target | See the package-specific API reference |
| Supported Node.js | * |
| License | MIT |
| Module type | commonjs |
| Main entry | ./moment.js |
| Module entry | ./dist/moment.js |
| Types | ./moment.d.ts |
| Runtime dependencies | none |
Installation
npm install @stackline/moment-coreUsage and API reference
A maintained Moment.js API package for parsing, validating, manipulating, and formatting dates with support for strict parsing, locale bundles, UTC workflows, durations, browser-ready minified assets, and TypeScript declarations.
Documentation & Live Demos | npm | GitHub Download | Security | Issues | Repository
Latest version: 1.0.5
Credits: Original project by Iskren Ivov Chernev and the Moment.js contributors. Maintained and republished by Alexandroit under the Stackline scope.
Why this library?
@stackline/moment-core keeps the stable Moment.js API available under active package ownership for
teams that still depend on its parsing, formatting, locale, duration, and relative-time behavior.
The package stays intentionally close to the classic Moment.js API, while cleaning up metadata and
preserving browser-ready bundles, locale files, and TypeScript declarations.
Moment remains a legacy API in maintenance mode. New applications should evaluate modern date/time
libraries, while existing applications can use this package when behavioral compatibility is the
primary requirement. The package version is 1.0.3; moment.version intentionally remains
2.30.1 for runtime compatibility.
Features
| Feature | Supported | | :--- | :---: | | Stackline 1.0.3 maintenance release on the Moment.js API | ✅ | | Parse common date inputs and custom formats | ✅ | | Strict parsing and validation diagnostics | ✅ | | Localized formatting and calendar output | ✅ | | Relative time and duration helpers | ✅ | | UTC and offset-aware workflows | ✅ | | 138 locale bundles | ✅ | | TypeScript declaration files | ✅ | | Browser-ready minified bundles | ✅ | | Versioned docs per published package release | ✅ |
Table of Contents
- Published Version Compatibility
- Installation
- Direct Download
- Setup
- Basic Usage
- Core APIs
- Browser Assets
- Run Locally
- Publishing
- Security
- Community and Links
- License
- Credits
Published Version Compatibility
| Package version | Upstream base | Runtime target | TypeScript declarations | Demo link |
| :---: | :---: | :--- | :--- | :--- |
| 1.0.3 | Moment 2.30.1 plus accepted upstream fixes through 2026-08-18 | ES5+ browsers and Node.js | Verified with TypeScript 1.8 through 7.0 | Moment 1.0.3 docs |
| 1.0.2 | Moment 2.30.1 plus accepted upstream fixes through 2026-08-18 | ES5+ browsers and Node.js | Verified with TypeScript 1.8 through 7.0 | Moment 1.0.2 docs |
| 1.0.1 | Moment 2.30.1 plus accepted upstream fixes through 2026-08-18 | ES5+ browsers and Node.js | Verified with TypeScript 1.8 through 7.0 | Moment 1.0.1 docs |
| 1.0.0 | Moment API baseline | ES5+ browsers and Node.js | moment.d.ts + ts3.1-typings/ | Moment 1.0.0 docs |
Installation
npm install @stackline/moment-coreDirect Download
If your project loads JavaScript directly in the browser, download the prebuilt release from GitHub:
The archive includes moment.min.js, moment-with-locales.min.js, and locales.min.js.
<script src="./moment.min.js"></script>
<script>
const value = moment('2026-04-03 14:30', 'YYYY-MM-DD HH:mm', true);
console.log(value.isValid(), value.format('LLLL'));
</script><script src="./moment-with-locales.min.js"></script>
<script>
moment.locale('fr');
console.log(moment().format('LLLL'));
</script>Setup
import moment from '@stackline/moment-core';
import '@stackline/moment-core/locale/fr';
moment.locale('fr');Basic Usage
import moment from '@stackline/moment-core';
const parsed = moment('2026-04-03 14:30', 'YYYY-MM-DD HH:mm', true);
const isoOutput = parsed.clone().utc().format('YYYY-MM-DDTHH:mm:ss[Z]');
const longOutput = parsed.format('LLLL');
const relativeOutput = parsed.fromNow();
console.log({ isoOutput, longOutput, relativeOutput });Core APIs
| API | Description |
| :--- | :--- |
| moment(input) | Creates a local instance from strings, numbers, arrays, objects, and native Date values. |
| moment(input, format, strict) | Parses using a declared token pattern and optional strict validation. |
| moment.utc(input) | Creates a UTC-based moment instance. |
| moment.parseZone(input) | Preserves the original offset encoded in the input string. |
| moment.duration(value, unit) | Creates a duration for humanize, ISO serialization, and unit conversion. |
| moment.locale(locale) | Sets the active locale for formatting and relative time output. |
| moment.relativeTimeThreshold(unit, value) | Tunes relative time cutover thresholds. |
| moment.relativeTimeRounding(fn) | Overrides rounding behavior for relative time strings. |
Browser Assets
The published package keeps the classic Moment.js distribution layout:
| File | Description |
| :--- | :--- |
| moment.js | Classic CommonJS/browser entry |
| dist/moment.js | ESM-friendly build |
| locale/ | Individual locale bundles |
| min/moment.min.js | Browser-ready minified build |
| min/locales.min.js | Browser-ready locale bundle |
| min/moment-with-locales.min.js | Browser-ready build with locales included |
| moment.d.ts | TypeScript declarations |
| ts3.1-typings/ | Alternate declarations for TS 3.1+ consumers |
Run Locally
The maintained development dependencies use exact Stackline aliases. The
karma override references the direct dependency ($karma) so the compatible
Classic Karma API satisfies the installed plugins' peer graph. A fresh install,
npm ls --all, audit and actual Chromium/Firefox tests validate this setup;
--legacy-peer-deps is not used. Historical TypeScript packages remain independent
compatibility compilers. Inherited Grunt/Karma transitive deprecations are
recorded under the original-parent-only migration scope, without claiming an
unrestricted dependency-closure policy pass.
npm install
npm run lint
npm test
npm run build
npm run build:docsPublishing
Releases are built, tested, and published through the repository's GitHub Actions workflow using npm trusted publishing and provenance. The workflow verifies the tested tarball's SHA-512 digest before publishing.
Security
Please report suspected vulnerabilities privately using the process in SECURITY.md. Do not include secrets or exploit details in a public issue.
Community and Links
Use the repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline to share examples, ask usage questions, and discuss releases.
License
MIT. See LICENSE.
Credits
- Original project: Iskren Ivov Chernev and the Moment.js contributors
- Upstream repository: https://github.com/moment/moment
- Maintained by: Alexandroit
Credits and original authors
- Alexandroit.
- Tim Wood.
- Rocky Meza.
- Matt Johnson.
- Isaac Cambron.
- Andre Polykanine.
- Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.
Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.
Community and Links
Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.
