How to use sppurge - 2 common examples

To help you get started, we’ve selected a few sppurge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github koltyakov / sp-build-tasks / src / tasks / watch.ts View on Github external
const purge = async (filePath: string): Promise => {
    const configs: IGulpConfigs = global.gulpConfigs || await getConfigs(settings);

    const sppurgeOptions: IPurgeOptions = {
      folder: configs.appConfig.spFolder,
      localFilePath: filePath,
      localBasePath: configs.appConfig.distFolder
    };

    sppurge(configs.privateConf as any, sppurgeOptions)
      // .then(res => {
      //   if (res.statusCode) {
      //     console.log('File has been deleted:', res.statusMessage);
      //   } else {
      //     console.log(res.statusCode, res.statusMessage);
      //   }
      // })
      .catch((err) => {
        if ((err.error || { error: { code: '' } }).error.code.split(',')[0] === '-2146232832') {
          console.log('File has not been removed as it was not there in SharePoint.');
        } else {
          console.log('Error:', err.message);
        }
      });
  };
github koltyakov / sp-build-tasks / src / utils / files.ts View on Github external
constructor (settings: IDeploySettings) {
    this.settings = {
      ...settings,
      dist: settings.dist || './dist'
    };
    this.sppurge = new Delete();
    this.spr = createRequest(this.settings.creds);
  }

sppurge

Delete files from SharePoint document libraries using Node.js without hassles

MIT
Latest version published 3 years ago

Package Health Score

40 / 100
Full package analysis

Popular sppurge functions