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

@microsoft/gscan

v0.0.5

Published

Provides reporting on G-Suite assets

Downloads

15

Readme

Google Site Scanner

The Google Site Scanner (gscan) cli tool allows you to gather basic statistics around existing v1 Google Sites. These include number of sites, types of content, and last updated values.

Install

Prerequisites

Installation

npm install -g @microsoft/gscan

Setup

Create Google Service Account (one-time)

  1. Create a service account in your Google tenant
  2. Grant that account permissions to use the "https://sites.google.com/feeds" scope
  3. Download the client configuration file and save it as "credentials.json" into the app working directory

Create configuration file (one-time)

The behavior of the cli tool is controlled by a JavaScript configuration file named gscan-config.js. This allows you some flexibility as you can use code in the configuration. This file should be located in your app working directory and be named gscan-config.js. The application expects a single export with the following structure. "credentialPath", "domain", and "impersonatingAccount" are required, the rest are optional.

{
    credentialPath: string,
    domain: string,
    impersonatingAccount: string,
    maxResultsPerPage: 100,
    output: ["csv", "json"],
    verbose: boolean,
    loggingListener: (entry: {}) => void,
    useDefaultLogging: boolean,
    logFileName: string,
    proxyUrl: string,
}

Example Configuration File

Minimal:

module.exports = {
    credentialPath: "./credentials.json",
    domain: "mydomain.com",
    impersonatingAccount: "[email protected]"
};

Extended:

module.exports = {
    credentialPath: "./credentials.json",
    domain: "mydomain.com",
    impersonatingAccount: "[email protected]",
    maxResultsPerPage: 25,
    output: ["json", "csv"],
    verbose: true,
    loggingListener: (entry) => console.log(entry.message),
    useDefaultLogging: false,
    logFileName: "mylog.txt",
    proxyUrl: "https://my.proxy.url",
};

Suppress log file:

module.exports = {
    credentialPath: "./credentials.json",
    domain: "mydomain.com",
    impersonatingAccount: "[email protected]",
    logFileName: "",
};

|Option|Description| |--|--| |credentialPath|Path relative to the working directory where the Google credentials file can be found| |domain|The Google domain to scan. The tool can process a single domain at a time| |impersonatingAccount|The account the app will impersonate, must have access to all of the sites you want to scan.=| |maxResultsPerPage|[Optional, default 100] Controls the page size when reading feeds| |output|[Optional, default "json"] Controls what output is generated. Array of "json" or "csv"| |verbose|[Optional, default false] If true extended information will be included in the logs| |loggingListener|[Optional, default null] Allows you to supply an additional logging function that will receive all logging messages. Function takes a single argument and returns null. The argument will be { message: string, level: 0|1|2|3|99, data: any }. 0 = Verbose| |useDefaultLogging|[Optional, default true] If true logging is also written to the console.| |logFileName|[Optional, default 'gscan_log_{timestamp}.txt'] Name of the log file, set to empty string to supress log file generation.| |proxyUrl|[Optional]Url to a network proxy (added in 0.0.3)|

  1. Open a command prompt to the folder where you saved the credentials and configuration file
  2. Run gscan

Build

To build the solution execute:

npm run build

Publish

To publish a new version you need to increment the version number appropriately and then publish the solution. The publish command handles rebuilding the solution.

npm version patch
npm publish

Debug

If you are using VS Code F5 debugging is setup. It expects a local folder named "gscan-local-testing" containing the credentials and config files, you can adjust this path in the launch file.