You would need to add code like the following to the JavaScript section of the project...
Code:
if (!window.harlowe){
window.harlowe = {"State": State};
}
...which would create a
harlowe JavaScript variable that you could use to access the story format's State from the Console...
WARNING:
Harlowe's History system is based on
You must be registered to see the links
, so it doesn't work the same as SugarCube's. Harlowe also uses its own custom implementations of the Array & Data-map objects internally, so they don't always behave the same as the Standard JavaScript implementation.
Because of this care needs to be taken when using JavaScript to altering an Array or a Data-map variable, because you can easily corrupt previous Moments in History if you update the object without first cloning it.
eg. if a DataMap variable was last updated in the project three Passage's ago, then the most recent instance of that object would exist in the Moment that represents three steps in the 'past'. And if you directly altered that object (without cloning it first) then you would be altering that past Moment as well as the ones between that one and the 'current' Moment.