How create npc via js plugin?

RPG Maker MV
How create npc via js plugin?
Where search rpg maker full js library?
you need to give more info about what you want to do.

Usually it is much easier to create events in the editor, and at maximum copy them by javascript if you need to make something special.
creating an event completely by javascript is usually a very bad idea and not easy, and not needed for any form of game.
I just want make all on js, because js code not enougth space in window.

My example, doesn't work, why?

Code:
function test() {$gameParty.gainGold(8); $gameMessage.add("You received 8 gold!")}
$gameMap._interpreter.setupChoices([['Yes','No'],1]);
$gameMessage.setChoiceCallback(function(responseIndex) {
if (responseIndex === 0){test()}
if (responseIndex === 1){$gameMessage.add("You received 8 gold!")}
}
Use Hudell's OrangeCustomEventCreator
I just want make all on js, because js code not enougth space in window.

My example, doesn't work, why?

Code:
function test() {$gameParty.gainGold(8); $gameMessage.add("You received 8 gold!")}
$gameMap._interpreter.setupChoices([['Yes','No'],1]);
$gameMessage.setChoiceCallback(function(responseIndex) {
if (responseIndex === 0){test()}
if (responseIndex === 1){$gameMessage.add("You received 8 gold!")}
}

Not enough space in Window? What window? Do you mean the text box? Then you either need to enter a break line when the text reaches the first line in the text box or if you need more room in the text box make sure you click on "Batch entry" on the text window as this will give you like enough space to enter as much text as you want.

Original thread: https://forums.rpgmakerweb.com/threads/how-create-npc-via-js-plugin.91253/