urlstring - The url of the profile.
Returns _Profile - The Profile instance.
Load profile via url.
You must register your profile path via profile.register before you can use it.
You also can set a schema for your profile via profile.registerSchema. NOTE: only root profile have the schema.
Example:
const profile = require('electron-profile');
// register a project profile
profile.register( 'project', '~/foo/bar');
// load the profile at ~/foo/bar/foobar.json
let foobar = profile.load('profile://project/foobar.json');
profile.registerSchema({
foo: 'foo',
bar: 'bar',
});
// change and save your profile
foobar.set('foo', 'hello foo');
foobar.save();typestring - The type of the profile you want to register.pathstring - The path for the register type.
Register profile type with the path you provide.
typestring - Current typeparentstring - The parent type
Sets the parent of the given type. This allows you get profile value from your parent (even parent's parent profile) when the value not found in current profile.
Reset the registered profiles
typestring - The type of the profile you've registered.
Get the registered path by type.
urlstring - The url of the profile.jsonobject - Restricted input type, And the default profile to use if the profile is not found.
Set a schema for profile. And the schema data to use if the profile is not found. NOTE: only root profile have the schema.
keystring - Data key value
Gets the stored data.
keystring - Data key valuevalueProfile data
Gets the schema currently in effect.