Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/project/formatters/prettier-lib.ts
1447 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
// The whole purpose of this is to only load prettier if we really need it – this saves a few MB of project memory usage
7
8
let instance: { format: Function } | null = null;
9
10
export function get_prettier() {
11
if (instance == null) {
12
instance = require("prettier");
13
}
14
return instance;
15
}
16
17