首页 \ 问答 \ 如何在我的package.json文件中包含扩展名(How to include extension on my package.json file)

如何在我的package.json文件中包含扩展名(How to include extension on my package.json file)

我想在我的package.json文件中包含此扩展名ol3-layerswitcher

我的package.json:

{
  "name": "TEST",
  "version": "1.0.0",
  "description": "OpenLayers 3",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "beefy app.js:bundle.js --live",
    "compile:dev": "./node_modules/.bin/browserify app.js -o bundle.js",
    "compile:prod": "./node_modules/.bin/browserify app.js | uglifyjs > bundle.js"
  },
  "author": "test",
  "license": "MIT",
  "dependencies": {
    "jquery": "^3.1.0",
    "jquery-ui": "^1.12.0",
    "openlayers": "^3.17.1",
    "ol3-layerswitcher": "^1.0.2"
  },
  "devDependencies": {
    "browserify": "^13.0.0",
    "uglify-js": "^2.7.0",
    "beefy": "^2.1.8"
  }
}

I want to include this extension ol3-layerswitcher on my package.json file

My package.json:

{
  "name": "TEST",
  "version": "1.0.0",
  "description": "OpenLayers 3",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "beefy app.js:bundle.js --live",
    "compile:dev": "./node_modules/.bin/browserify app.js -o bundle.js",
    "compile:prod": "./node_modules/.bin/browserify app.js | uglifyjs > bundle.js"
  },
  "author": "test",
  "license": "MIT",
  "dependencies": {
    "jquery": "^3.1.0",
    "jquery-ui": "^1.12.0",
    "openlayers": "^3.17.1",
    "ol3-layerswitcher": "^1.0.2"
  },
  "devDependencies": {
    "browserify": "^13.0.0",
    "uglify-js": "^2.7.0",
    "beefy": "^2.1.8"
  }
}

原文:https://stackoverflow.com/questions/38824077
更新时间:2022-06-08 06:06

最满意答案

你忘了带领你的地址:

fin.read(( char* ) &kfstruct.num_views, sizeof( int ) );
                  ^^^

[ sizeof(kfstruct.num_views) ,请注意,从维护的角度来看,做sizeof(kfstruct.num_views) 因此,如果类型发生变化,您的代码仍然有效。 ]


You forgot to take the address of your fields:

fin.read(( char* ) &kfstruct.num_views, sizeof( int ) );
                  ^^^

[As an aside, note that it's better from a maintenance point of view to do sizeof(kfstruct.num_views). So if the type ever changes, your code will still work.]

相关问答

更多
  • 尝试通过引用来抛弃这些std::fstream 。 class MyDevice : public HIDDevice { public: void read(std::fstream&); void write(std::fstream&); }; Try tossing those std::fstreams around by reference. class MyDevice : public HIDDevice { public: ...
  • 要完成您的要求,您需要使用new运算符,如下所示: SmartIO::SmartIO(const char * filepath , Mode mode) : fs(NULL), buffer(NULL), offset(0) { switch (mode) {   case Mode::inText: { fs = new fstream(filepath,fstream::in|fstream::ate); ...
  • 目前接受的答案是错误的。 当使用自动存储返回一个局部变量,其类型与声明的函数返回类型相同时,则会执行两个阶段的过程: fstream open_user_file() const { fstream f; /*...*/ return f; } 首先执行副本构造函数的选择,就好像对象是由右值指定的一样。 如果第一个重载决策失败或未执行,或者所选构造函数的第一个参数的类型不是对象类型的rvalue引用(可能是cv-qualified),则再次执行重载决策,将对象视为左值。 这意味 ...
  • 这很可能是因为您没有为libstdc ++安装调试符号(这是std::fstream所在的位置)。 如果您只是尝试打印input变量,您将得到类似这样的内容,而无需libstdc ++的调试符号: (gdb) p input $1 = 我在Fedora上重现了这个问题,在我用这个命令安装调试信息后,问题就消失了( input变量被成功打印,并且input.fail() ): sudo debuginfo-install libstdc++ 另请参见std::strin ...
  • 你忘了带领你的地址: fin.read(( char* ) &kfstruct.num_views, sizeof( int ) ); ^^^ [ sizeof(kfstruct.num_views) ,请注意,从维护的角度来看,做sizeof(kfstruct.num_views) 。 因此,如果类型发生变化,您的代码仍然有效。 ] You forgot to take the address of your fields: fin.read(( char* ) &k ...
  • 您正在阅读4个字符, 但未添加零终止符 ,而且由于您没有比较字符串的平等性,因此您的比较是错误的,您应该这样做: char buffer[5]; std::ifstream in(fn, std::ios::binary); in.read(buffer, 4); buffer[4] = '\0'; // Add a zero-terminator at the end if (strcmp(buffer,"RIFF")) { // If buffer isn't {'R','I','F','F','\0' ...
  • 您需要在write_file()中关闭您的文件: void html::write_file() { file.close(); file.open(path, ios::out); file.seekg(0); file << "\n title : " << title << "\n body : " << body; file.close(); print(); } 然后在print() ,你应该重新打开它: void file_handler::pr ...
  • basic_fstream派生自basic_iostream ,它是从basic_istream和basic_ostream 。 因此, basic_fstream具有来自basic_ostream函数seekg和来自basic_ifstream函数basic_ifstream 。 简而言之,在您的情况下,对seekp和seekg的调用会执行相同的操作,因为basic_filebuf::seekpos执行的操作仅取决于basic_filebuf打开模式。 basic_ostream
  • myStream.write(temp2.c_str(), 100); myStream << temp2 << endl; 你为什么两次把它写到文件中,为什么你告诉它“我喜欢深盘披萨”是100个字符长? 仅仅使用第二行应该做你想要的。 我认为循环结束的原因是你在读取文件时正在编写文件,这会导致getline混淆。 如果文件很小,我只需将整个内容读入stringstream ,替换要替换的行,然后将整个stringstream写入文件。 在原地更改文件要困难得多。 例: #include
  • 您没有flush , close或delete流,因此缓冲区未被刷新。 您的堆栈版本有效,因为当对象在超出范围后被销毁时,流被刷新并关闭。 刷新流,例如通过调用flush或close ,或者使用delete preproc;删除指针delete preproc; 。 如果可能的话,最好还是不要使用在堆上分配的对象。 您也可以通过调用将您的fstream设置为无缓冲模式 preproc->rdbuf()->pubsetbuf(NULL, 0); // nullptr for C++11 打开流后立即,虽然这 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)