Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Blog “a-neat-way-to-use-dynamic-javascript-imports”
  • Loading branch information
dmcdaniel90 committed Aug 1, 2025
commit aed2ea41153b3b3fb06d2116689b74b42eb0d365
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ I'll go into more detail about the project in another post, but today I want to

I have a function `parseCsvToJson` that uses a utility function called `blankline` to simply log a blank line to the console. I have this utility function in a file called `functions.ts`, containing other functions I may need. This works, but it means that the `parseCsvToJson` function is dependent on `functions.ts`.

```ts
```typescript
import { blankLine } from '../functions.js'

export default function parseCsvToJson(filePath: string) {
// Code...
}
}f
```

### Dynamic imports
```ts

```typescript
const { blankLine } = await import('../functions.js')

### Conditional Operators
```