New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

spfx-jsom

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spfx-jsom

Simplifies JSOM for SPFx

latest
Source
npmnpm
Version
0.6.6
Version published
Weekly downloads
15
-82.14%
Maintainers
1
Weekly downloads
 
Created
Source

spfx-jsom

Use JSOM in SPFx with async-await. spfx-jsom takes care of loading the required SP libs.

Install

npm i spfx-jsom --save

Import using commonjs

import initSpfxJsom, { ExecuteJsomQuery, JsomContext } from "spfx-jsom";

Sample 1 - Get all web properties

async function getAllWebProperties() {
    try {
      const jsomCtx: JsomContext = await initSpfxJsom([SITE_URL]);
      const webAllProperties = jsomCtx.web.get_allProperties();
      await ExecuteJsomQuery(jsomCtx, [{ clientObject: webAllProperties }]);
      return webAllProperties.get_fieldValues();
    } catch (err) {
      throw err;
    }
  }

FAQs

Package last updated on 17 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts