generic-typescript-library

A generic Typescript library template.

Usage no npm install needed!

<script type="module">
  import genericTypescriptLibrary from 'https://cdn.skypack.dev/generic-typescript-library';
</script>

README

Generic Typescript Library

A starter template for creating a reusable library with Typescript.

To run locally

In this template project directory

  • Update name in package.json
  • npm run link
  • npm run dev

In another project directory

  • npm link <the name used in the template's package.json>
  • npm start

Example React Component

import  React  from  'react';
import { reverseString } from  'generic-typescript-library';

const  App: React.FC = () => {
  const  reversed = reverseString('Kyle, you\'ve got thi!')
  return (
    <div>{reversed}</div>
  );
}
export  default  App;

Updating the template library directory while running npm run dev will automatically trigger hot reloading in the parent project.

To publish

  • npm run build && npm publish