npm.io
1.2.1 • Published 6 years ago

jsom-ctx

Licence
MIT
Version
1.2.1
Deps
0
Size
18 kB
Vulns
0
Weekly
0

jsom-ctx

Simplifies JSOM usage, and allows for async-await.

Examples

Get web title for current web

(async function () {
    try {
        let ctx = new JsomContext(_spPageContextInfo.webAbsoluteUrl);
        ctx = await ctx.load();
        await ExecuteJsomQuery(ctx, [ctx.web, ctx.lists]);
        console.log(ctx.web.get_title());
    } catch (err) {
        console.log(err);
    }
})();

Keywords