{"id":45318282,"url":"https://github.com/laslibs/las-js","last_synced_at":"2026-02-21T07:53:43.778Z","repository":{"id":44076878,"uuid":"205795922","full_name":"laslibs/las-js","owner":"laslibs","description":"Typescript/JavaScript library for parsing standard well log files (Geophysical well logs))","archived":false,"fork":false,"pushed_at":"2024-07-20T06:44:27.000Z","size":385,"stargazers_count":28,"open_issues_count":4,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-09T09:43:42.028Z","etag":null,"topics":["csv","javascript-library","las","las-js","parsing","typescript","well-logs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/las-js","language":"Lasso","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laslibs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-02T07:00:50.000Z","updated_at":"2024-10-25T08:10:48.000Z","dependencies_parsed_at":"2024-10-22T08:00:06.288Z","dependency_job_id":null,"html_url":"https://github.com/laslibs/las-js","commit_stats":{"total_commits":84,"total_committers":9,"mean_commits":9.333333333333334,"dds":"0.19047619047619047","last_synced_commit":"079de55a7228261e158c08102d546d1dfdd3d8f4"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/laslibs/las-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laslibs%2Flas-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laslibs%2Flas-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laslibs%2Flas-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laslibs%2Flas-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laslibs","download_url":"https://codeload.github.com/laslibs/las-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laslibs%2Flas-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","javascript-library","las","las-js","parsing","typescript","well-logs"],"created_at":"2026-02-21T07:53:43.603Z","updated_at":"2026-02-21T07:53:43.768Z","avatar_url":"https://github.com/laslibs.png","language":"Lasso","funding_links":["https://www.patreon.com/bePatron?u=19152008"],"categories":[],"sub_categories":[],"readme":"![](https://github.com/laslibs/las-js/workflows/Node%20CI/badge.svg?)\n![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/las-js?style=flat-square)\n![npm type definitions](https://img.shields.io/npm/types/las-js?style=flat-square)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/las-js?style=flat-square)\n![GitHub issues](https://img.shields.io/github/issues/iykekings/las-js?style=flat-square)\n![NPM](https://img.shields.io/npm/l/las-js?style=flat-square)\n![npm](https://img.shields.io/npm/v/las-js?style=flat-square)\n\n# las-js is a zero-dependency JavaScript library for parsing .Las file (Geophysical well log files).\n\n### Currently supports only version 2.0 of [LAS Specification](https://www.cwls.org/wp-content/uploads/2017/02/Las2_Update_Feb2017.pdf).  For more information about this format, see the Canadian Well Logging Society [product page](https://www.cwls.org/products/).\n\n## How to use\n\n- Installing\n\n  \u003e NPM\n\n  ```sh\n  $npm install las-js\n  ```\n\n  \u003e Yarn\n\n  ```sh\n  $yarn add las-js\n  ```\n\n  \u003e Browser\n\n  ```html\n  \u003cscript defer src=\"https://cdn.jsdelivr.net/npm/las-js/dist/browser.js\"\u003e\u003c/srcipt\u003e\n  ```\n\n- Usage\n\n  import/require las-js module\n\n  \u003e Node\n\n  ```js\n  // common js\n  const { Las } = require('las-js');\n  // esm\n  import { Las } from 'las-js';\n  const myLas = new Las(`./sample/example1.las`);\n  ```\n\n  You can also pass LAS file contents directly to constructor\n\n  ```js\n  // common js\n  const { Las } = require('las-js');\n  const fs = require('fs');\n  const data = fs.readFileSync(`./sample/example1.las`, { encoding: 'utf8' });\n  // add loadFile: false to constructor options\n  const myLas = new Las(data, { loadFile: false });\n  ```\n\n\u003e Browser\n\nlas-js adds a global class Lasjs\n\n```js\nconst input = document.getElementById('file-input');\ninput.addEventListener('change', async e =\u003e {\n  const file = e.target.files[0];\n  const myLas = new Lasjs(file);\n});\n// or\nconst myLas = new Lasjs('https://raw.githubusercontent.com/iykekings/las-js/master/src/__test__/sample/A10.las'); // url - only on browser\n```\n\n- Read data\n\n  \u003e Use Laspy.data to get a 2-dimensional array containing the readings of each log,\n  \u003e Or Lasjs.dataStripped to get the same as above but with all rows containing null values stripped off\n\n  ```js\n  async function read() {\n    try {\n      const data = await myLas.data();\n      console.log(data);\n      /**\n         [[2650.0, 177.825, -999.25, -999.25],\n          [2650.5, 182.5, -999.25,-999.25],\n          [2651.0,180.162, -999.25, -999.25],\n          [2651.5, 177.825, -999.25, -999.25],\n          [2652.0, 177.825, -999.25, -999.25] ...]\n        */\n\n      const dataStripped = await myLas.dataStripped();\n      console.log(dataStripped);\n      /**\n       [[2657.5, 212.002, 0.16665, 1951.74597],\n       [2658.0, 201.44, 0.1966, 1788.50696],\n       [2658.5, 204.314, 0.21004, 1723.21204],\n       [2659.0, 212.075, 0.22888, 1638.328],\n       [2659.5, 243.536, 0.22439, 1657.91699]...]\n       */\n    } catch (error) {\n      console.log(error);\n    }\n  }\n  ```\n\n- Get the log headers\n\n\n    ```javascript\n        // ...\n        const headers = await myLas.header();\n        console.log(headers);\n        // ['DEPTH', 'GR', 'NPHI', 'RHOB']\n       // ...\n    ```\n\n- Get the log headers descriptions\n\n\n    ```Js\n        //...\n        const headerAndDescr = await myLas.headerAndDescr();\n        console.log(headerAndDescr)\n        // {DEPTH: 'DEPTH', GR: 'Gamma Ray', NPHI: 'Neutron Porosity', RHOB: 'Bulk density'}\n        // ...\n    ```\n\n- Get a particular column, say Gamma Ray log\n\n\n    ```Js\n        // ...\n        const gammaRay = await myLas.column('GR');\n        console.log(gammaRay);\n        // [-999.25, -999.25, -999.25, -999.25, -999.25, 122.03, 123.14, ...]\n        // ...\n    ```\n    ```Js\n        // ...\n        // get column with null values stripped\n        const gammaRay = await myLas.columnStripped('GR');\n        console.log(gammaRay);\n        // [61.61, 59.99, 54.02, 50.87, 54.68, 64.39, 77.96, ...]\n        // ...\n    ```\n    \u003e Note this returns the column, after all the data has been stripped off their null values, which means that valid data in a particular column would be stripped off if there is another column that has a null value at that particular row\n\n- Get the Well Parameters\n\n  ### Presents a way of accessing the details of individual well parameters.\n\n  ### The details include the following:\n\n        1. descr - Description/ Full name of the well parameter\n        2. units - Its unit measurements\n        3. value - Value\n\n  ```Js\n    // ...\n    const well = await myLas.wellParams()\n    const start = well.STRT.value // 1670.0\n    const stop = well.STOP.value // 1669.75\n    const null_value = well.NULL.value //  -999.25\n    // Any other well parameter present in the file, can be gotten with the same syntax above\n    // ...\n  ```\n\n- Get the Curve Parameters\n\n  ### Presents a way of accessing the details of individual log columns.\n\n  ### The details include the following:\n\n        1. descr - Description/ Full name of the log column\n        2. units - Unit of the log column measurements\n        3. value - API value of the log column\n\n  ```Js\n    // ...\n    const curve = await myLas.curveParams()\n    const NPHI = curve.NPHI.descr // 'Neutron Porosity'\n    const RHOB = curve.RHOB.descr // 'Bulk density'\n    // This is the same for all log column present in the file\n    // ...\n  ```\n\n- Get the Parameters of the well\n\n  ### The details include the following:\n\n        1. descr - Description/ Full name of the log column\n        2. units - Unit of the log column measurements\n        3. value - API value of the log column\n\n  ```Js\n    // ...\n    const param = await myLas.logParams(); // 'BOTTOM HOLE TEMPERATURE'\n    const BHT = param.BHT.descr // 'BOTTOM HOLE TEMPERATURE'\n    const BHTValaue = param.BHT.value // 35.5\n    const BHTUnits = param.BHT.units // 'DEGC'\n    // This is the same for all well parameters present in the file\n    // ...\n  ```\n\n- Get the number of rows and columns\n\n\n    ```Js\n        // ...\n        const numRows = await myLas.rowCount() // 4\n        const numColumns = await myLas.columnCount() // 3081\n        // ...\n    ```\n\n- Get the version and wrap\n\n\n    ```Js\n        // ...\n        const version = await myLas.version() // '2.0'\n        const wrap = await myLas.wrap() // true\n        // ...\n    ```\n\n- Get other information\n\n  ```Js\n      // ...\n      const other = await myLas.other()\n      console.log(other)\n      // Note: The logging tools became stuck at 625 metres causing the data between 625 metres and 615 metres to be invalid.\n      // ...\n  ```\n\n- Export to CSV\n\n  ### For node, this writes a csv file to the current working directory, with headers of the well and data section only for node. For browser, this returns a File Blob, that can be downloaded by using _URL.createObjectURL_\n\n  ```Js\n      //...\n      await myLas.toCsv('result')\n      // result.csv has been created Successfully!\n      //...\n  ```\n\n  \u003e result.csv\n\n  | DEPT | RHOB    | GR      | NPHI  |\n  | ---- | ------- | ------- | ----- |\n  | 0.5  | -999.25 | -999.25 | -0.08 |\n  | 1.0  | -999.25 | -999.25 | -0.08 |\n  | 1.5  | -999.25 | -999.25 | -0.04 |\n  | ...  | ...     | ...     | ...   |\n  | 1.3  | -999.25 | -999.25 | -0.08 |\n\n  Or get the version of csv with null values stripped\n\n  ```Js\n      // ...\n      await myLas.toCsvStripped('clean')\n      // clean.csv has been created Successfully!\n      // ...\n  ```\n\n  \u003e clean.csv\n\n  | DEPT | RHOB  | GR   | NPHI  |\n  | ---- | ----- | ---- | ----- |\n  | 80.5 | 2.771 | 18.6 | -6.08 |\n  | 81.0 | 2.761 | 17.4 | -6.0  |\n  | 81.5 | 2.752 | 16.4 | -5.96 |\n  | ...  | ...   | ...  | ...   |\n  | 80.5 | 2.762 | 16.2 | -5.06 |\n\n- Browser and Node Supports\n\n  \u003e las-js is written in typescript and compiles to es6.\n\n  - Browser\n    Supports IE 10 and 11 - (doesn't yet support url)\n    Doesn't support Opera Mini\n  - Node\n    Tested 0n 8, 10 and 12\n\n- ## Support\n  las-js is an MIT-licensed open source project. You can help it grow by becoming a sponsor/supporter.[Become a Patron!](https://www.patreon.com/bePatron?u=19152008)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaslibs%2Flas-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaslibs%2Flas-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaslibs%2Flas-js/lists"}