Skip to content

Commit

Permalink
Add example project
Browse files Browse the repository at this point in the history
  • Loading branch information
Karibash committed Aug 9, 2021
1 parent bea3c05 commit 31f96a6
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 0 deletions.
13 changes: 13 additions & 0 deletions example/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Unit, ConvertLengthUnitArgsOptions, convertUnits } from '@karibash/pixel-units';

const convertOptions: ConvertLengthUnitArgsOptions = {
rem: '16px',
em: '16px',
viewHeight: '1920px',
viewWidth: '1080px',
};

const pixel: Unit<'px'> = '32px';
const rem = convertUnits(pixel, 'rem', convertOptions);

console.log({ pixel, rem });
101 changes: 101 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scripts": {
"start": "ts-node index.ts"
},
"dependencies": {
"@karibash/pixel-units": "file:../dist",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"
}
}
26 changes: 26 additions & 0 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"skipLibCheck": false,
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"importHelpers": true,
"removeComments": true,
"esModuleInterop": true,
"pretty": true,
"newLine": "lf",
"outDir": "dist",
"rootDir": "src",
"strictNullChecks": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src/**/*.ts"]
}

0 comments on commit 31f96a6

Please sign in to comment.