notepadqq-api

0.9.5 • Public • Published

notepadqq-api

API for Notepadqq extensions in Node.js

npm version

Install

npm install notepadqq-api

Getting started

// First, require the module
var NotepadqqApi = require("notepadqq-api").NotepadqqApi
 
// Connect to Notepadqq
NotepadqqApi.connect(function(api) {
 
    // Print the version of Notepadqq to the console
    console.log("Version " + api.notepadqq.version())
 
    // We initialize each window here
    api.onWindowInitialization(function(window) {
 
        // Add a new menu item
        var menu = window.addExtensionMenuItem(api.extensionId, "My menu")
 
        // Add an handler to the "triggered" event of the menu item: it
        // will be called when the user clicks on the menu.
        menu.on("triggered", function() {
 
            // Replace the selected text in the currently opened tab
            // with the string "Hello World"
            window.currentEditor().setSelectionsText(["Hello World"]);
 
        });
 
    });
 
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.9.53latest

Version History

VersionDownloads (Last 7 Days)Published
0.9.53
0.9.42
0.9.32
0.9.22
0.9.12
0.9.02

Package Sidebar

Install

npm i notepadqq-api

Weekly Downloads

13

Version

0.9.5

License

MIT

Last publish

Collaborators

  • danieleds