1.0.4 • Published 12 months ago

@runnerpro/frontend v1.0.4

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
12 months ago

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
1.0.1

1 year ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.0

1 year ago

0.0.2

1 year ago