- Editor.Protocol
- Methods
- Editor.Protocol.register (protocol, fn)
- Editor.Protocol.register (protocol, fn)
- Methods
Editor.Protocol
Protocol module used in Editor.url and custom protocol.
Methods
Editor.Protocol.register (protocol, fn)
protocolstring - Protocol namefnfunction
Register a protocol so thatEditor.urlcan use it to convert an url to the filesystem path.Thefnaccept an url Object via url.parse.
Example:
const Path = require('path');let _url2path = base => {return uri => {if ( uri.pathname ) {return Path.join( base, uri.host, uri.pathname );}return Path.join( base, uri.host );};};Editor.Protocol.register('editor-framework', _url2path(Editor.frameworkPath));
