Index | Files | Directories

package closure

import ""

Package closure provides tools to help with the use of the closure library.



Package Files


func DeepParseDeps Uses

func DeepParseDeps(r io.Reader) (map[string][]string, error)

DeepParseDeps reads closure namespace dependency lines and returns a map giving all the required js files for each namespace.

func GenDeps Uses

func GenDeps(root http.FileSystem) ([]byte, error)

GenDeps returns the namespace dependencies between the closure javascript files in root. It does not descend in directories. Each of the files listed in the output is prepended with the path "../../", which is assumed to be the location where these files can be found, relative to Closure's base.js.

The format for each relevant javascript file is: goog.addDependency("filepath", ["namespace provided"], ["required namespace 1", "required namespace 2", ...]);

func GenDepsWithPath Uses

func GenDepsWithPath(pathPrefix string, root http.FileSystem) ([]byte, error)

GenDepsWithPath is like GenDeps, but you can specify a path where the files are to be found at runtime relative to Closure's base.js.

func ParseDeps Uses

func ParseDeps(r io.Reader) (providedBy map[string]string, requires map[string][]string, err error)

ParseDeps reads closure namespace dependency lines and returns a map giving the js file provider for each namespace, and a map giving the namespace dependencies for each namespace.


genclosuredepsThe genclosuredeps command, similarly to the closure tool, outputs to os.Stdout for each .js file, which namespaces it provides, and the namespaces it requires, hence helping the closure library to resolve dependencies between those files.
jstestPackage jstest uses the Go testing package to test JavaScript code using Node and Mocha.

Package closure imports 10 packages (graph) and is imported by 64 packages. Updated 2018-02-10. Refresh now. Tools for package owners.