Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@textlint/module-interop
Advanced tools
ECMAScript module interop library.
import .default
from ES module or CommonJS module.
example.mjs
const value = 42;
export default value;
import {moduleInterop} from "@textlint/module-interop";
// Doesn't matter if `require` uses `module.exports` or ES Module `export`
const value = moduleInterop(require("./example"));
console.log(value); // 42
Notes: This library is for common use. This library is not depended on textlint.
Some rule modules use export default
.
If you creating rule preset for textlint, you should wrap the required result.
const rule = require("textlint-rule-es-export-default-example");
console.log(rule); // { default: ruleImplementation }
This library resolve this issue by moduleInterop
function.
const {moduleInterop} = require("@textlint/module-interop");
const rule = moduleInterop(require("textlint-rule-es-export-default-example"));
console.log(rule); // ruleImplementation
Install with npm:
npm install @textlint/module-interop
const {moduleInterop} = require("@textlint/module-interop");
const rule = moduleInterop(require("textlint-rule-example")); // rule implementation
require
that prevent static analyzer like Asset Relocator Loader for Webpack.See Releases page.
Install devDependencies and Run npm test
:
npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu
FAQs
ECMAScript module interop library
The npm package @textlint/module-interop receives a total of 95,476 weekly downloads. As such, @textlint/module-interop popularity was classified as popular.
We found that @textlint/module-interop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.