GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Modules Modules
Glenn Block edited this page
#What is a Module? A Module is a unit of functionality that extends the scriptcs runtime itself. Modules have access to all the core service that scriptcs uses, they can modify existing services, replace them completely or introduce new services. A few examples of the kinds of things you can do with modules:
As you can see modules are extremely powerful! #Installing
Modules are installed via NuGet as packages. Unlike script packs, these packages are stored in a global location as they apply to scriptcs itself rather than to a particular script. To install a module you use the #Loading
Specify which modules you want loaded at runtime with the scriptcs start.csx -modules mymodule #Authoring Here are the steps for authoring a module:
Below is an example of a super simple HelloWorld Module which simply writes a "Hello World" message to the console when the module is loaded. [Module("helloworld", Extensions = "csx")] public class HelloWorldModule : IModule { public void Initialize(IModuleConfiguration config) { Console.WriteLine("Hello World"); } } While developing a module, you will need to test it and may need to step through and debug. To test your module follow these steps.
[Here] (https://github.com/scriptcs-contrib/scriptcs-sample-module) is a sample module that you can clone to start playing with developing modules. The README contains full instructions to get it building and to test it out.
Clone this wiki locally |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |