google-url-helper
v1.0.3
Published
A tiny library for building and parsing google urls
Downloads
234
Maintainers
Readme
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 Docsspreadsheet
- Google Sheetsform
- Google Formspresentation
- Google Slidesfolder
- Google Drive folderfile
- 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.