puter.fs.space()Returns the storage capacity and usage of the current user.
puter.fs.space()
None.
A Promise that resolves to a SpaceInfo object with these properties:
capacity (Number): The total storage capacity available to the user, in bytes.used (Number): The amount of storage the user has used, in bytes.Show how much storage the user has used
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
const { used, capacity } = await puter.fs.space();
const toMB = (bytes) => (bytes / 1024 / 1024).toFixed(1);
puter.print(`Used ${toMB(used)} MB of ${toMB(capacity)} MB`);
})();
</script>
</body>
</html>