google-url-helper

1.0.3 • Public • Published

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.

Package Sidebar

Install

npm i google-url-helper

Weekly Downloads

48

Version

1.0.3

License

MIT

Last publish

Collaborators

  • darahayes