My Purescript Prelude
$ pnpm i ssh://[email protected]:rajatsharma/primordials.git
$ pnpx primordial-link
- Compile handlebars:
import Primordials.Handlebars (mkCompilerWithVariables)
comileHandlebarsTemplate :: Effect String
comileHandlebarsTemplate = do
pure mkCompilerWithVariables { name: "World" } "Hello, {{name}}!" -- "Hello, World"
- Create File path:
import Primordials.Node.FileOps (mkPath)
mainDirPath :: Path.FilePath
mainDirPath = mkPath [ "src", "main", "scala" ]
- Copy directory with contents:
import Primordials.Node.FileOps (copyDir)
copyDirectoryWithContents :: Effect Unit
copyDirectoryWithContents = copyDir (mkPath [ "src" ]) (mkPath [ "test" ])
- Replace text in file:
import Primordials.Node.FileOps (copyDir)
replaceInFile :: Effect Unit
replaceInFile = replace { files: "src/index.js", from: ";", to: "" }