age-ts
v3.1.0
Published
A simple React component that calculates your age
Maintainers
Readme
Age.ts
This is a simple NextJs component that calculates your age.
Installation
Install the package via npm:
npm install age-tspnpm:
pnpm i age-tsor yarn:
yarn add age-tsUsage
Import the Age component and use it in your NextJS application:
"use-client";
import Age from "age-ts";
function App() {
return <Age />;
}
export default App;Environment Variable
Set the BIRTHDATE environment variable in the following format:
NEXT_PUBLIC_BIRTHDATE = '<your birthdate here>'Or just pass the birthdate argument through the component like this:
"use-client";
import Age from "age-ts";
function App() {
return <Age birthdate='01-01-2001' />;
}
export default App;