Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main entry point and type definitions #92

Merged
merged 4 commits into from
May 8, 2019
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented May 8, 2019

Update package.json to add main entry point and type definitions.

Basically Marp CLI has not provided internal API for Node because we want to focus a behavior in the scope of CLI/CUI. However, an exported function from entry point is useful as a minimum interface to use CLI via Node.

const marp = require('@marp-team/marp-cli')

(async () => {
  const exitCode = await marp(['marp.md', '-o', 'marp.html'])
  if (exitCode === 0) {
    // succeeded
  } else {
    // error
  }
})()

This function may be used in Marp for VS Code: marp-team/marp-vscode#4

yhatt added 4 commits May 8, 2019 12:43
- Add keywords
- Update repository link
- Specify main entry point
version.ts has resolved package.json from project root by. Thus, type
definitions will create based on root directory, not `src` dir. So
`types` field requires adding extra `src` directory.
@yhatt yhatt merged commit 2444118 into master May 8, 2019
@yhatt yhatt deleted the update-package-json branch May 8, 2019 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant