Include/Import local file dependency
See original GitHub issueIn a project, I have multiple kotlin script files, and I have some methods I need to use in most, if not all script.
Is there an existing way to write these method in a single external file, and include it from the other scripts ?
eg : utils.kts
fun foo(s : String) : String {
//...
}
myscript.kts
#!/usr/bin/env kscript
//INCLUDE utils.kts
foo(args[0])
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
node.js - How to import local dependency from node_modules
I have done npm install ./pathtolocalfolder --save . My package.json has a dependency with name: file: ../pathtolocalfolder .
Read more >npm install supports local packages and dependencies
The npm install command supports local development and allows to quickly install and symlink local modules and packages.
Read more >How to import a local module dependency in Elixir
This guide will show you how to take an Elixir package you've made locally and import it into another project using the file...
Read more >Dependency resolution - Parcel
It is recommended to include the full file extension in all import specifiers. This both improves dependency resolution performance and reduces ambiguity.
Read more >How to use local Node packages as project dependencies
How to use local Node packages as project dependencies · Install yalc. Install yalc · Publish a package to your local yalc store....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That seems perfect for what I want !
I’ve implemented it in a separate branch for now. See https://github.com/holgerbrandl/kscript/blob/include_directive/test/resources/includes/include_variations.kts for an example. Feel welcome to let me know what you think.