plaint-typescript
v1.0.0
Published
This is an example of how to use coffeeless validator on JavaSript/TypeScript applications
Readme
Plaint test typescript example to use Coffeeless Validator
Seting up local testing:
Option 1
- Use npm link (Symlink for Development)
This method creates a symbolic link between the package and the examples/plain-typescript folder, allowing you to test changes in real-time.
In the package root directory run:
npm linkThis command creates a global symlink to the package.
- In examples/plain-typescript directory:
npm link coffeeless-validatorThis links the global symlink to your examples/plain-typescript folder's node_modules.
- Import the package in index.ts:
import { ValidationBuilder as Builder } from 'coffeeless-validator/dist';Option 2
- Use npm pack (Simulate NPM Package)
This method creates a tarball of the package, simulating how it would be published to NPM.
In the package root directory run:
npm packThis command generates a .tgz file, e.g., coffeeless-validator-1.0.0.tgz.
- In the examples/plain-typescript directory:
npm install ../../coffeeless-validator-1.0.0.tgz- Import then package in index.ts: import { yourFunction } from 'coffeeless-validator';
Start the test:
npm run start