Injects <meta>
into document head.
Injects custom <meta>
into document head. For example, you can use <meta>
to know what version of your package is being used in a web app.
import { injectMeta, npm } from 'inject-meta-tag';
// Will inject <meta name="my-package" content="1.0.0" /> into document head.
injectMeta('my-package', '1.0.0');
// Will inject <meta name="npm:my-package" content="version=1.0.0" /> into document head.
npm('my-package', { version: '1.0.0' });
The following is simplified version of the API. Please refer to our published typings for the full version.
injectMeta(name: string, content?: string | undefined): void;
npm(name: string, init: { version: string }): void;
Like us? Star us.
Want to make it better? File us an issue.
Don't like something you see? Submit a pull request.