New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/office-js

Package Overview
Dependencies
Maintainers
2
Versions
1189
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/office-js

Office JavaScript API

  • 0.1.0-beta.1
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Office Javascript API

Office Javascript API enables you to access content in Office documents.

Usage

Use Office JavaScript API in Node.js Application

Using TypeScript
import * as Excel from '@microsoft/office-js/excel'

var accessToken: string;
// getAccessToken() method is is implemented by you and it returns OAUTH access token
accessToken = getAccessToken();
// Assume that there is a file 'book.xlsx' in the OneDrive root folder
var workbookUrl = "https://graph.microsoft.com/v1.0/me/drive/root:/book.xlsx:/workbook";
var session = new Excel.Session(workbookUrl, {Authorization: "Bearer " + accessToken});
Excel.run(session, (context) => {
    var r = context.workbook.worksheets.getItem('Sheet1').getRange("A1:B2");
    r.values = [["Hello", "World"], [1234, "=B2 + 100"]];
    r.load();
    return context.sync()
        .then(() => {
            console.log(JSON.stringify(r.values));
        });
});

Using JavaScript
import * as Excel from '@microsoft/office-js/excel'

var accessToken;
// getAccessToken() method is is implemented by you and it returns OAUTH access token
accessToken = getAccessToken();
// Assume that there is a file 'book.xlsx' in the OneDrive root folder
var workbookUrl = "https://graph.microsoft.com/v1.0/me/drive/root:/book.xlsx:/workbook";
var session = new Excel.Session(workbookUrl, {Authorization: "Bearer " + accessToken});
Excel.run(session, function(context){
    var r = context.workbook.worksheets.getItem('Sheet1').getRange("A1:B2");
    r.values = [["Hello", "World"], [1234, "=B2 + 100"]];
    r.load();
    return context.sync()
        .then(function() {
            console.log(JSON.stringify(r.values));
        });
});

Keywords

FAQs

Package last updated on 10 Dec 2016

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