Skip to main content
static insertKeyWord(NOTEPath: string, page: number, keyword: string):
 Promise<APIResponse<boolean>>;
Parameters
ParameterTypeDescription
NOTEPathstringNOTE/DOC file path
pagenumberPage number (starts from 0)
keywordstringKeyword content
Returns

Example

import { PluginFileAPI } from 'sn-plugin-lib';

/**
 * Insert keyword example.
 */
export async function exampleInsertKeyWord() {
 const NOTEPath = '/storage/emulated/0/Note/demo.note';
 const page = 1;
 const keyword = 'TODO';

 const res = await PluginFileAPI.insertKeyWord(NOTEPath, page, keyword);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'insertKeyWord call failed');
 }
 return res.result;
}