@runnerpro/frontend
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

modern-npm-package

An npm packages for common frontend logic between client and dashboard app.

Get Started

  1. Run npm install @runnerpro/frontend

Functions

b64toBlob

Transform base64 file to blob data for sending file

  • Param: file in base64
  • Return: blob data file

fileToB64

Transform File (from input type file) to base 64 for inserting value in src

  • Param: file from input type file
  • Return: promise with base 64 file

Deploy new version

  1. Create a folder with the name of functionality and index.ts inside. Write the function and export it.
  2. In main index.ts (the one inside src), import and export it
  3. Change the version number of the package (using this convenction)
  4. Run npm login
  5. Run npm run publish

Testing

  1. Install developer dependencies using the following command in your terminal npm i -D mocha @types/mocha chai @types/chai ts-node
  2. Create a new file .mocharc.json in the root directory with the following contents:
    {
      "extension": ["ts"],
      "spec": "./**/*.spec.ts",
      "require": "ts-node/register"
    }
  3. Create a tests folder
  4. Create an index.spec.ts file in the tests folder
  5. Write unit tests in the index.spec.ts file to test the code in index.ts
  6. Add a "test" property in the package.json file and give it a value of "mocha"
  7. Run npm test in your terminal from the root folder of the project

Package Sidebar

Install

npm i @runnerpro/frontend

Weekly Downloads

115

Version

1.0.1

License

MIT

Unpacked Size

6.5 kB

Total Files

14

Last publish

Collaborators

  • lamas-running