@crow281/ts-file-module-template
    Preparing search index...

    @crow281/ts-file-module-template

    ts-file-module-template

    This repository provides a template to simplify creating new TypeScript NPM packages.

    This template has the following properties:

    • Source files are treated as modules. For example, if you have a class "SomeClass" in file "src/some-folder1/some-folder2/SomeClass.ts", then you can import it from the resulting NPM library via:
    import {
    SomeClass
    } from "@my_scope/package_name/some-folder1/some-folder2/SomeClass";
    • It builds using Rollup and Babel.
    • It supports importing JSON, CSV, TSV, and React JSX/TSX files in addition to TypeScript and Javascript.

      Examples of how to import JSON and CSV are in folder "src/printing" .

    • It uses knip to help you find any problems with your project's dependencies.
    • It supports pre-generating JSON Schema validation code via AJV .
    • It has a code generator script built over json-schema-to-typescript , making it easy to create TypeScript interfaces based on your json schema and load JSON files into them.
    • You can check for problems in your code via ESLint
    • You can keep your code formatting consistent using Prettier.
    • You can debug via Jest. Example test files are in "__tests__" folders under the src folder.
    • You can generate documentation for your project via Typedoc.

    You can access the github project here.

    You can read instructions to use this template for your very own NPM project right here.

    The API documentation is available here.

    Whether due to curiosity, needing to fix a bug, or needing to modify it, you can read the details behind how this template works over here.

    A guide to all the NPM project scripts, such as test and build, is located here.