mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 05:31:51 +02:00
Initial "plugin" system with importer (#7)
This commit is contained in:
4
plugins/hello-world/greet.js
Normal file
4
plugins/hello-world/greet.js
Normal file
@@ -0,0 +1,4 @@
|
||||
export function greet() {
|
||||
// Call Rust-provided fn!
|
||||
sayHello('Plugin');
|
||||
}
|
||||
7
plugins/hello-world/index.js
Normal file
7
plugins/hello-world/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import { greet } from './greet.js';
|
||||
|
||||
export function hello() {
|
||||
greet();
|
||||
console.log('Try JSON parse', JSON.parse(`{ "hello": 123 }`).hello);
|
||||
console.log('Try RegExp', '123'.match(/[\d]+/));
|
||||
}
|
||||
Reference in New Issue
Block a user