Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ZMP command line utility makes easier to create Zalo Mini Program (ZMP). CLI the most recommended way to start ZMP app development.
Install zmp-cli (may require "sudo"):
$ npm install -g zmp-cli
Run the following command to get usage helps:
$ zmp
Directly:
$ zmp <command> [options]
To create ZMP app, create a Zalo app and run the following command in the directory where you want to create app:
$ mkdir mini-app && cd mini-app
$ zmp create
Program will prompt for few questions about Zalo App ID, Zalo access token, framework and template you want to start with.
Run the following command in the directory where you want to create app:
$ zmp create --ui
It will launch UI where you will be able to configure the project. By default it launches server on localhost:3001
address. If you want to change the port then use --port <n>
argument:
$ zmp create --ui --port 8080
$ zmp start
$ zmp deploy
To open your app, you must use Zalo App to scan QR code after deploy done
Change file app.json
to config your app when it is launched.
Example:
{
"window": {
"titleHeader": "My App",
"orientation": 0,
"color": "#15A6FB",
"rightMenu": {
"data": [],
"supportToolBar": 0,
"reset": 0
},
"leftMenu": {
"buttonType": 1,
"confirmToExit": 1,
"dialogMessage": "Bạn có muốn đóng app này không?"
}
},
"debug": false
}
▸ getAccessToken(): Promise<any>
Get Access Token.
async
function
getAccessToken
example
ZMP.apis.getAccessToken().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ login(): Promise<any>
Login to call more action.
async
function
Login
example
ZMP.apis.login().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ getVersion(): string
Get the current version of sdk.
Returns: string
Zalo Mini App version.
▸ setDeviceOrientation(object
: DeviceOrientationType): Promise<any>
Sets the color of the navigation bar in the page.
async
function
setDeviceOrientation
example
ZMP.apis.setDeviceOrientation({
rotate: 0
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | DeviceOrientationType |
Returns: Promise<any>
▸ setNavigationBarColor(object
: NavBarColorType): Promise<any>
Sets the color of the navigation bar in the page.
async
function
setNavigationBarColor
example
ZMP.apis.setNavigationBarColor({
color: "#000000"
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | NavBarColorType |
Returns: Promise<any>
▸ setNavigationBarLeftButton(object
: NavBarLeftMenuType): Promise<any>
Dynamically sets the left button of the current page.
async
function
setNavigationBarLeftButton
example
ZMP.apis.setNavigationBarLeftButton({
buttonType: 1,
confirmToExit: 1,
dialogMessage: 'Bạn có muốn đóng app này không?'
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | NavBarLeftMenuType |
Returns: Promise<any>
▸ setNavigationBarTitle(object
: NavBarTitleType): Promise<any>
Dynamically sets the title of the current page.
async
function
setNavigationBarTitle
example
ZMP.apis.setNavigationBarTitle({ title: "Current Page" }).then((res) => { console.log("Success"); }).catch((error) => { console.log("Fail"); });
Name | Type |
---|---|
object | NavBarTitleType |
Returns: Promise<any>
FAQs
ZMP command line utility (CLI)
The npm package zmp-cli receives a total of 103 weekly downloads. As such, zmp-cli popularity was classified as not popular.
We found that zmp-cli 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.