Can I use nodejs to call Vitepress's API?
See original GitHub issueIs your feature request related to a problem? Please describe.
Can I use nodejs to call Vitepress’s API?Or will there be such a change in the future?
Because I want to encapsulate VitePress to make it easier to generate some functionally similar documents in different projects, rather than duplicating VitePress configuration in different projects.
Describe the solution you’d like
Use an API like this in nodejs:
vuepress.dev({
// some config or specify the configuration file location
})
vuepress.build({
// some config or specify the configuration file location
})
Describe alternatives you’ve considered
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn’t already an issue that asks for the same feature to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
HTTPS | Node.js v19.3.0 Documentation
In such cases, attempting to import from https or calling require('node:https') will result in an error being thrown. When using CommonJS, the error...
Read more >API Reference | VitePress
VitePress offers several built in API to let you access app data. VitePress also comes with few built-in component that can be used...
Read more >vuejs/vitepress: Vite & Vue powered static site generator.
It is already suitable for out-of-the-box documentation use, but the config and theming API may still change between minor releases.
Read more >vitepress - npm
Currently, it's in the alpha stage. It is already suitable for out-of-the-box documentation use, but the config and theming API may still change ......
Read more >How to Make Secure HTTP Requests with Vue and Express
Learn how to build a secure Express API and make API calls to it from ... can use JavaScript across the board: on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@brc-dd First of all thanks for your reply.
I did read part of the source code,But haven’t tried coding my program yet.
My consideration is that these APIs are not officially exposed (or written in the document), and future updates of Vitepress may cause these methods to not be used correctly, and it will be difficult for my program to use the latest and better Vitepress.
So my other question is, will there be an official node-api for users in the future?
So, in your wrapper you will need to install vitepress and write some stuff like this:
I mentioned that cli.ts file for reference on how to use those three functions.