Socket
Socket
Sign inDemoInstall

google-url-helper

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-url-helper

A tiny library for building and parsing google urls


Version published
Weekly downloads
162
increased by157.14%
Maintainers
1
Install size
4.78 kB
Created
Weekly downloads
 

Readme

Source

google-url-helper

  • Parsing
    • parseId ( url )
    • parse ( url )
  • Building
    • url ( id , type )

Parsing

parseId ( url )

const gurl = require('google-url-helper')
var url = 'https://docs.google.com/document/d/1ss-FBQi1TGq8kiYLAjYkKx9672oxb9u_JJyL4lCVmls/edit'

gurl.parseId(url)
// '1ss-FBQi1TGq8kiYLAjYkKx9672oxb9u_JJyL4lCVmls'

parse ( url )

const gurl = require('google-url-helper')
var url = 'https://docs.google.com/document/d/1ss-FBQi1TGq8kiYLAjYkKx9672oxb9u_JJyL4lCVmls/edit'

gurl.parse(url)
// {id: '1ss-FBQi1TGq8kiYLAjYkKx9672oxb9u_JJyL4lCVmls, type: 'document'}

The following url types can be parsed:

  • document - Google Docs
  • spreadsheet - Google Sheets
  • form - Google Forms
  • presentation - Google Slides
  • folder - Google Drive folder
  • file - Google Drive file

Building

url ( id , type )

const gurl = require('google-url-helper')

var id = '1ss-FBQi1TGq8kiYLAjYkKx9672oxb9u_JJyL4lCVmls'
var type = 'document'

gurl.url(id, type)
// 'https://docs.google.com/document/d/1ss-FBQi1TGq8kiYLAjYkKx9672oxb9u_JJyL4lCVmls'

The following url types can be built

  • document
  • spreadsheet
  • presentation
  • folder
  • file

Note: forms cannot be built because they are specific to organizations.

Keywords

FAQs

Last updated on 28 Nov 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc