CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/project/formatters/prettier-lib.ts
Views: 687
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