# languages

The main export of `src/connectors/languages` is the `scan` method:

```ts
const scan = async (): Promise<Record<string, Package[]>> { ... }
```

This method looks at a series of regular expressions for filenames, scans all the files in the cwd to see if they match a regex, and if they do it looks up the corresponding file scanner. The result is an object whose keys are the matched filenames, and the values are an array of `Package[]` representing the dependencies contained within the file.

For example, if you run `foxglove` in a directory containing a `poetry.lock` file, this will be matched to the `scanPoetryLockfile` scanner in the `python` directory, and your output would look something like the following:

```shell
$ cat poetry.lock
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.

[[package]]
name = "annotated-types"
version = "0.7.0"

[[package]]
name = "anyio"
version = "4.4.0"
```

```ts
const result = await scan();
console.log(JSON.stringify(result, null, 2));
{
  "poetry.lock": [
    {
      "name": "annotated-types",
      "version": {
        "identifier": "0.7.0"
      }
    },
    {
      "name": "anyio",
      "version": {
        "identifier": "4.4.0"
      }
    }
  ]
}
```
