Journalism Format - v1.1.12
    Preparing search index...

    Journalism Format - v1.1.12

    The Journalism Library (format functions)

    Useful TypeScript functions for journalism projects. This library focuses on easily formatting numbers, dates, and more. It's part of the journalism library.

    The library is available on npm, with documentation on GitHub Pages.

    The documentation is also available as llms.txt, an index of the individual documentation pages for AI agents, and llm.md, a complete Markdown reference for AI coding assistants or offline reading.

    The library is maintained by Nael Shiab, computational journalist and senior data producer for CBC News.

    Tip

    To learn how to use this library and more, check out Code Like a Journalist, a free and open-source data analysis and data visualization course in TypeScript. You might also find the simple-data-analysis library interesting.

    Requires Node.js 24.21.0 or later. Use import and set "type": "module" in your project's package.json.

    npm install @nshiab/journalism-format
    
    import { formatNumber } from "@nshiab/journalism-format";

    console.log(formatNumber(1234.56)); // "1,234.56"

    To quickly set up a data project with essential folders, configurations, and documentation for AI agents, you can use @nshiab/setup-data-project.

    npx @nshiab/setup-data-project
    

    If you wish to contribute, please check the guidelines.