Main site

Importing JavaScript and Data

With JsRates, you can import JavaScript code from .js, .mjs, .ts, or .txt files, as well as data from CSV files that are automatically converted to JSON objects.

To import files, follow these steps:

  1. Go to the Editor page.
  2. Click on the More Actions dropdown.
  3. Choose Import to open the import window.
  4. Upload your file from your local system or paste the file URL.

Upon importing a CSV file, it will be parsed into a JSON object where:

  • CSV column headers become JSON keys.
  • Rows under each header are converted into an array of values for their respective keys, forming the JSON object values.

See an example on importing large data (the postal codes of 16,146 cities in Australia) for custom carrier rates. Importing data - sample code

Importing code or data in JsRates