Coder Social home page Coder Social logo

patrick-rodgers / generator-sp-pnp-js-sample Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 14 KB

This project contains a Yeoman generator which establishes a sample project to help you get started using the sp-pnp-js library.

JavaScript 54.28% TypeScript 45.72%

generator-sp-pnp-js-sample's Introduction

PnP SharePoint Sample Generator

This project contains a Yeoman generator which establishes a sample project to help you get started using the sp-pnp-js library.

Getting Started

Ensure you install Yeoman

> npm install -g yo

Install typings if you don't have it

> npm install -g typings

Install the Yeoman Generator

> npm install -g generator-sp-pnp-js-sample

Create a directory where you want to load the template

    > mkdir samples
    > cd samples

Run npm init and respond to prompts (defaults are fine)

> npm init

Run the generator

> yo sp-pnp-js-sample

Add the script tag and associated div to a script editor web part on your SharePoint site

    <script type="text/javascript" src="http://localhost:8080/bundle/example-bundle.js" data-divid="pnp-sample-container"></script>
    <div id="pnp-sample-container"></div>

Begin serving the samples by running this command:

> gulp serve

Refresh the page to see the hello world sample. You can un-comment the other samples and try them, or write your own code. This pattern can be used to write your own standalone apps. When changes are made to any of the files the bundle will be re-built for you and you can refresh the page to see your updates.

Build

You can also run the build command to create a minified bundle for deployment. It will be written to the build folder.

> gulp build

generator-sp-pnp-js-sample's People

Contributors

patrick-rodgers avatar

Stargazers

Colin Dekker avatar Ahmed Samir avatar Oscar Medina avatar Mauricio avatar

Watchers

Oscar Medina avatar  avatar  avatar  avatar

Forkers

mauricionr

generator-sp-pnp-js-sample's Issues

Several issues and improvements

Hi,
there are several issues or improvements that can be in the documentations as well as the generator.

npm install -g yo typings generator-sp-pnp-js-sample

This will install all dependencies at once.

In general npm init is not required for yeoman generator because you deploy or create a package.json directly through the execution of the generator. In general it is easier to deploy the package.json right throught the installation of yeoman.

http://localhost:8080/ won't work in Office 365 because you need to have https. Otherwise the script won't be loaded.

The final consideration is that this yeoman generator is not suiteable nor useful. It is just a sample not a project template. In your case the easier and more apropriate method would have been to instruct the people to download this sample and how to use and install the node packages.

If I can help you with something let me know. ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.