# Fun with Eval plugin (quick prototyping of simple plugins)

**URL:** https://discourse.joplinapp.org/t/fun-with-eval-plugin-quick-prototyping-of-simple-plugins/13604
**Category:** Plugins
**Created:** [4 January 2021 15:28 UTC](https://discourse.joplinapp.org/t/fun-with-eval-plugin-quick-prototyping-of-simple-plugins/13604 "2021-01-04T15:28:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ambrt](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ambrt/32/4428_2.png) [@ambrt](https://discourse.joplinapp.org/u/ambrt)
#### Post date: [4 January 2021 15:28 UTC](https://discourse.joplinapp.org/t/fun-with-eval-plugin-quick-prototyping-of-simple-plugins/13604/1 "2021-01-04T15:28:52Z")

</div>

So i created eval plugin as a basic calculator. But next thing that came to my mind is that it can be used as a quick plugin testing facility.

The long story short is that you can execute any code that would normally belong to `execute` method of register command  
( in `await joplin.commands.register({execute: async () => { }})` )  
right from within editor pane  
Below is a link to example of how to search for notes and get JSON back

> [@Simple Eval](https://discourse.joplinapp.org/t/simple-eval/13250/5):
>
> I made small but substantial modification: await before eval. This allows to have results from Promises. Like, how to get data from joplin package, for example: joplin.data.get(['search'], { query:"test",fields: ['id', 'title','body'] }).then(res =\> JSON.stringify(res, null,2)) Executing this inside a note with Eval plugin will return JSON with notes that normally would be returned by search for query test. { "items": [ { "id": "02400acada214e099bb8124e28d337f1", "titl…
