npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

g10-spapi

v1.4.4

Published

Helper library for SharePoint API.

Downloads

73

Readme

g10-spapi

Helper library for SharePoint API.

import SpBuilder from 'g10-spapi'

const sp = new SpBuilder()
Configure an instance of axios
import { axiosManager } from 'g10-spapi'

axiosManager.setInstance('https://myportal.mydomain.com/sites/MySite/', { cookie: global.data.cookie, timeout:10000, metadata: 'nometadata' })

axiosManager.setInstance('https://myproxy:4443/sites/MySite/', { mode: 'sp-rest-proxy' })

This library doesn't support authentification. You must suministrate a cookie for raw mode (node-sp-auth), o using sp-rest-proxy

  • Basic Examples
  • run() --> runs the query directly to Sharepoint(raw), or vía Rest Proxy SP (sp-rest-proxy)

  • build() --> Give you information of the url and options.

List management

await sp.lists().queryByTitle('MyList').exist() //--> List exists.

await sp.lists().queryBy({ BaseTemplate: 100 }).run() //--> Query for list with Base Template 100

await sp.lists().add({ Title: 'MyList', DisableCommenting: true }).run() //--> List creation

await sp.lists().getByTitle('MyList').update({ DisableCommenting: false }).run() //--> List update

await sp.lists().getByTitle('MyList').del().run() //--> Delete list

...

Field/List management. Include lookups.

await sp.fields(listName).getById(r.Id).exist() // --> Field exists.

await sp.fields(listName).add({ Title: 'isActive', FieldTypeKind: eKind.Boolean, DefaultValue: true }).run() // --> Create boolean field.

await sp.fields(listName).add({ Title: 'Salary', FieldTypeKind: eKind.Number, MinimumValue: 0 }).run()

await sp.fields(listName).add({ Title: 'MyField', LookupListName: 'MyListB', EnforceUniqueValues: true }).run()

await sp.fields(listName).getByTitle('MyField').update({RelationshipDeleteBehavior: eBehavior.None }).run()

...

Items


await sp.items(listName).queryBy().run()

await sp.items(listName).add({ Title: 'Theodora Swaniawski', Numb1: 5 }).run()

await sp.items(listName).queryBy({ isActive: true }, ['Title'], { top: 7 }).run()

await sp.items(listName).queryBy({ Title: 'Hester Weimann MD', Numb1: 100, $or: { Numb1: 1000 } }).run()

await sp.items(listName).queryBy({ Created: { $gt: g.date.addNowDays(-2) } }).run()

await sp
      .items(listName)
      .queryBy()
      .math({ $count: ['ID'], $sum: ['Numb1'], $avg: ['Numb1'], $max: ['Numb1'], $min: ['Numb1'], $countUniq: ['Tipo'], $exist: ['Title'], $trend: ['Numb1'] })
      .groupBy(['Tipo'])
      .run()

Views

Very similar to list, items, and fiels.

....

Search

await sp.search('text to search in portal', url: 'url to Portal.')

Utils

await sp.utils.exportList('MyList') --> Schema. Export list, no data. List, fields, views. 

await sp.utils.importList('MyList')

await sp.utils.analyzeDependencies()

In de future:

** Documents

** Batch

Buy me a coffee