Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-cloudfile-to-vocab

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-cloudfile-to-vocab

Takes vocab data from cloud spreadsheets and renders it into local json files.

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
Maintainers
3
Weekly downloads
 
Created
Source

NPM Build Status

cloudfile_to_vocab

Processes any spreadsheet in the cloud into a set of vocab json files.

Setup

  • Add grunt-cloudfile-to-vocab as a dependency in your project's package.json
  • In your Gruntfile.js, inside your grunt.initConfig(), add the following:
    cloudfile_to_vocab: {
        default: {
            options: {
                output_directory:      'source/vocabs',
                google_spreadsheet_id: '--google spreadsheet id--',
                worksheets:            ['Sheet1'],
                whitelisted_services:  ['english', 'mundo'],
                serviceEmail:          '--google service email--',
                certLocation:          '--full path to your service email certificate--'
            }
        }
    }

Register a task, e.g.

grunt.registerTask('make_vocabs',  ['cloudfile_to_vocab']);

Creating a service account email and certificate

  1. Go to https://console.developers.google.com
  2. Create a project
  3. In the project, go to 'APIs & Auth' -> 'Credentials' and 'Create New Client ID'
  4. Select 'Service Account' as the type and p12 as your container
  5. Convert the downloaded p12 to PEM with 'openssl pkcs12 -in [the pem file] -out google-oauth.pem -nocerts -nodes
  6. Copy your service email address into the config and change certLocation to the location of your generated certificate (.pem)

Usage

Create a Google spreadsheet and start populating it with content (see examples below).

Run your task to automatically generate vocab JSON files from a Google spreadsheet.

Running tests

To run the tests add a google account user name and password into the grunt config file.

Example input/output

Input

NB: The 'ignore' in the left column ensures that that row is not included in the rendered output.

               | english               | persian
ignore         | Instructions go here. | ...
project_header | Hello, World!         | سلام جهان!
project_intro  | This is my intro...   | این مقدمه من است ...

Output

english.json

{
    "project_header": "Hello, World!",
    "project_intro": "This is my intro..."
}

persian.json

{
    "project_header": "سلام جهان!",
    "project_intro": "این مقدمه من است ..."
}

You can now populate your project with these variables, thereby being able to deliver your project in a language-agnostic way, paving the way for delivering to multiple nationalities.

Known issues

Make sure you are not on a proxy network or it cannot connect to Google.

Keywords

FAQs

Package last updated on 17 Oct 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc