0.0.7 • Published 4 years ago
generic-typescript-library v0.0.7
Generic Typescript Library
A starter template for creating a reusable library with Typescript.
To run locally
In this template project directory
- Update
name
inpackage.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